aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-18 01:28:17 +0200
committerGitHub <noreply@github.com>2018-10-18 01:28:17 +0200
commitedcf640f599c292eeaa75860bcf440f37ce9ba61 (patch)
tree5bb2fd5199f72adadbd592c95fe45d9de5e97dfe
parent3059516e8ae04c6d2e1c41ac5f65896b4af2a196 (diff)
parent31f63c8d55fdd1108d391b35e4e95ad67492ff34 (diff)
downloadrneovim-edcf640f599c292eeaa75860bcf440f37ce9ba61.tar.gz
rneovim-edcf640f599c292eeaa75860bcf440f37ce9ba61.tar.bz2
rneovim-edcf640f599c292eeaa75860bcf440f37ce9ba61.zip
Merge #9130 'build: Fix for macOS 10.14/mojave'
fix #9050 Q: (from From #7891) > It turns out there's a difference between executing > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang > and /usr/bin/clang. CMake was picking up the former and with that it left off > a key include path. Why? A: /usr/bin/clang is a shim that uses libxcselect/libxcrun under the hood. $ otool -L /usr/bin/clang /usr/bin/clang: /usr/lib/libxcselect.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5) From https://macops.ca/developer-binaries-on-os-x-xcode-select-and-xcrun/ : > this shim binary loads functions in libxcselect.dylib that can locate the > path to the real binary, depending on how the system has been configured. One > part of this process is to check whether this path contains > usr/lib/libxcrun.dylib, and the xcrun tool, in which case it will invoke > xcrun to run the binary. > ... > (If all of this isn’t yet enough indirection for you, /usr/bin/xcrun itself > is a shim, and so libxcselect.dylib contains code to detect whether the > executed xcrun is a shim. Look for the __xcrun_shim segment in the __DATA > section output by the command: pagestuff /usr/bin/xcrun -a.)
-rw-r--r--third-party/CMakeLists.txt4
-rw-r--r--third-party/cmake/BuildLuajit.cmake11
2 files changed, 14 insertions, 1 deletions
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 4ca00b26cd..2c59d79c55 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -98,6 +98,10 @@ else()
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
endif()
+if(CMAKE_OSX_SYSROOT)
+ set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
+endif()
+
# Cross compiling: use these for dependencies built for the
# HOST system, when not crosscompiling these should be the
# same as DEPS_*. Except when targeting Unix in which case
diff --git a/third-party/cmake/BuildLuajit.cmake b/third-party/cmake/BuildLuajit.cmake
index 721bca9f63..e965927f4e 100644
--- a/third-party/cmake/BuildLuajit.cmake
+++ b/third-party/cmake/BuildLuajit.cmake
@@ -50,8 +50,17 @@ set(INSTALLCMD_UNIX ${MAKE_PRG} CFLAGS=-fPIC
install)
if(UNIX)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ # Set MACOSX_DEPLOYMENT_TARGET (else luajit defaults to 10.4). #9050
+ # https://github.com/LuaJIT/LuaJIT/blob/b025b01c5b9d23f6218c7d72b7aafa3f1ab1e08a/src/Makefile#L301-L303
+ set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ else()
+ set(DEPLOYMENT_TARGET "")
+ endif()
+
BuildLuaJit(INSTALL_COMMAND ${INSTALLCMD_UNIX}
- CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR})
+ CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
+ ${DEPLOYMENT_TARGET})
elseif(MINGW AND CMAKE_CROSSCOMPILING)