diff --git a/CMakeLists.txt b/CMakeLists.txt index a047858..2e72df1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,11 @@ option(COMPUTER_CPP_CODE_SIGN_APP "Code sign the macOS ComputerCpp.app bundle af option(COMPUTER_CPP_ENABLE_WARNINGS "Enable strict compiler warnings for project targets" ON) option(COMPUTER_CPP_ENABLE_SANITIZERS "Enable AddressSanitizer and UndefinedBehaviorSanitizer for project targets" OFF) +if(APPLE AND NOT DEFINED CACHE{CMAKE_FIND_FRAMEWORK}) + # Prefer SDK/Homebrew libraries over stale third-party framework bundles in /Library/Frameworks. + set(CMAKE_FIND_FRAMEWORK LAST) +endif() + function(computer_cpp_target_defaults target_name) target_compile_features(${target_name} PRIVATE cxx_std_20) diff --git a/src/cli/LuaPrelude.cpp b/src/cli/LuaPrelude.cpp index f570710..3e9fb9c 100644 --- a/src/cli/LuaPrelude.cpp +++ b/src/cli/LuaPrelude.cpp @@ -2563,6 +2563,7 @@ if not script then os.exit(2) end table.remove(arg, 1) +local unpack_args = table.unpack or unpack local chunk, load_error = loadfile(script) if not chunk then @@ -2571,7 +2572,7 @@ if not chunk then end local function main() - return chunk(table.unpack(arg)) + return chunk(unpack_args(arg)) end local ok, result = xpcall(main, debug.traceback)