From ae8cbfe4fd982e9f8134e5ab911574f2796af7b3 Mon Sep 17 00:00:00 2001 From: zhaozg Date: Sun, 22 Sep 2024 16:07:02 +0800 Subject: [PATCH] fix: XCode 16 and LuaJit no dedup workaround - https://github.com/surge-synthesizer/surge/pull/7793/commits/5ed7e573bd91ece3308d7a3d6ef90da3a840f477 - https://github.com/LuaJIT/LuaJIT/issues/1275 --- LuaJIT.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/LuaJIT.cmake b/LuaJIT.cmake index 3b905ad..04bc37a 100644 --- a/LuaJIT.cmake +++ b/LuaJIT.cmake @@ -594,6 +594,23 @@ if(IOS) set_xcode_property(libluajit IPHONEOS_DEPLOYMENT_TARGET "9.0" "all") endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Any Clang + # add_compile_options() + if(CMAKE_CXX_COMPILER_ID MATCHES "^AppleClang$") + # Apple Clang only + add_compile_options( + -faligned-allocation + -fasm-blocks + ) + + # LuaJit + XCode 16 goes blammo + add_link_options( + -Wl,-no_deduplicate + ) + endif() +endif() + if("${LJ_TARGET_ARCH}" STREQUAL "x86") if(CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCXX) target_compile_options(libluajit PRIVATE