From 5e65400c6f8112c4d012304fc39fb83ef53fd3f0 Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Fri, 17 Oct 2014 06:50:13 -0400 Subject: [PATCH] Add missing linker flags required for LuaJIT on 64-bit Mac OS X. This was brought up in #1294. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e79362940..c939507cc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,16 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") endif() +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8) + # Required for luajit. + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") + set(CMAKE_SHARED_LINKER_FLAGS + "${CMAKE_SHARED_LINKER_FLAGS} -image_base 100000000") + set(CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000") +endif() + option(USE_GCOV "Enable gcov support" OFF) if(USE_GCOV)