From 26afc6cf121413a02ff57ee215de90c810c3c0c2 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Fri, 13 Dec 2013 19:52:40 -0500 Subject: [PATCH] fix(cmake): fix problem of using LuaJit on OSX(64-bit) http://luajit.org/install.html If you're building a 64 bit application on OSX which links directly or indirectly against LuaJIT, you need to link your main executable with these flags: -pagezero_size 10000 -image_base 100000000 --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c6728f043..7cbdacfdf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -161,6 +161,15 @@ if ("${HAS_LUA_NEWSTATE}$" MATCHES "TRUE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D LEAN_USE_LUA_NEWSTATE") endif() +IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND ${LUA_FOUND} AND + "${LUA_INCLUDE_DIR}" MATCHES "jit") + # http://luajit.org/install.html + # If you're building a 64 bit application on OSX which links + # directly or indirectly against LuaJIT, you need to link your main + # executable with these flags: + set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") +ENDIF() + include_directories(${LEAN_SOURCE_DIR}) add_custom_command(