From 1a66ca6613eb40aee73283d4a94562e4a3944145 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 19:04:18 -0700 Subject: [PATCH 01/30] Update Travis to macOS 10.14 Mojave. --- .travis.yml | 2 +- travis.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b3417019..10eb8440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp sudo: required dist: xenial -osx_image: xcode10.1 # macOS 10.13 +osx_image: xcode11.3 # macOS 10.14 os: - linux - osx diff --git a/travis.sh b/travis.sh index 5d5350fc..47ef7b95 100755 --- a/travis.sh +++ b/travis.sh @@ -142,6 +142,8 @@ if [[ $(uname) = Darwin ]]; then hdiutil detach /Volumes/CUDAMacOSXInstaller fi + sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / + export PATH=$PWD:$PATH fi From c3badbc751dcee371b2eaa11987693d938db4243 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 21:18:27 -0700 Subject: [PATCH 02/30] Downgrade XCode to 10.3. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10eb8440..904ea940 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp sudo: required dist: xenial -osx_image: xcode11.3 # macOS 10.14 +osx_image: xcode10.3 # macOS 10.14 os: - linux - osx From 5363d0ab50bccdae07f3775d90ab7dc51c73ede5 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 21:24:10 -0700 Subject: [PATCH 03/30] Workaround macOS package issue. --- travis.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index 47ef7b95..d12710d3 100755 --- a/travis.sh +++ b/travis.sh @@ -142,7 +142,8 @@ if [[ $(uname) = Darwin ]]; then hdiutil detach /Volumes/CUDAMacOSXInstaller fi - sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / + # Hack: Seems the package isn't signed on some versions of macOS? + sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted export PATH=$PWD:$PATH fi From 266b3fc5644eeb0e6d7beef542f5c7bc799ccb34 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 21:28:57 -0700 Subject: [PATCH 04/30] Try a different XCode version. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 904ea940..787d1d7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp sudo: required dist: xenial -osx_image: xcode10.3 # macOS 10.14 +osx_image: xcode10.2 # macOS 10.14 os: - linux - osx From 60f8f71662f4b5932634aa18428ec99aff1ab9b1 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 21:59:09 -0700 Subject: [PATCH 05/30] Try a different type of workaround. --- .travis.yml | 2 +- travis.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 787d1d7c..904ea940 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp sudo: required dist: xenial -osx_image: xcode10.2 # macOS 10.14 +osx_image: xcode10.3 # macOS 10.14 os: - linux - osx diff --git a/travis.sh b/travis.sh index d12710d3..cefbc4e0 100755 --- a/travis.sh +++ b/travis.sh @@ -142,8 +142,11 @@ if [[ $(uname) = Darwin ]]; then hdiutil detach /Volumes/CUDAMacOSXInstaller fi - # Hack: Seems the package isn't signed on some versions of macOS? - sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted + # # Hack: Seems the package isn't signed on some versions of macOS? + # sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted + + # workaround for https://github.com/terralang/terra/issues/365 + export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" export PATH=$PWD:$PATH fi From cefdfa3f057041642167953d25d32fabb2d1a6cf Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 22:25:15 -0700 Subject: [PATCH 06/30] Try xcode-select --install. --- travis.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis.sh b/travis.sh index cefbc4e0..978e8d04 100755 --- a/travis.sh +++ b/travis.sh @@ -146,6 +146,7 @@ if [[ $(uname) = Darwin ]]; then # sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted # workaround for https://github.com/terralang/terra/issues/365 + xcode-select --install export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" export PATH=$PWD:$PATH From ef19e43e585ef382d7da966004992f35f72a96cc Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 22:41:24 -0700 Subject: [PATCH 07/30] Try using the command line tools SDK path. --- travis.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/travis.sh b/travis.sh index 978e8d04..caca2d73 100755 --- a/travis.sh +++ b/travis.sh @@ -146,8 +146,9 @@ if [[ $(uname) = Darwin ]]; then # sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted # workaround for https://github.com/terralang/terra/issues/365 - xcode-select --install - export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + # xcode-select --install + # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include export PATH=$PWD:$PATH fi From a216cbf170070d839285bf2647117904713c8fd5 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 17 Apr 2020 22:57:42 -0700 Subject: [PATCH 08/30] Try bumping XCode version again. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 904ea940..10eb8440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: cpp sudo: required dist: xenial -osx_image: xcode10.3 # macOS 10.14 +osx_image: xcode11.3 # macOS 10.14 os: - linux - osx From 2e162aaafe3176aaeaa99716cde7e83153b88552 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:04:08 -0700 Subject: [PATCH 09/30] Workaround for https://github.com/LuaJIT/LuaJIT/issues/575. --- Makefile | 3 ++- cmake/Modules/GetLuaJIT.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4689b16e..336e6a82 100644 --- a/Makefile +++ b/Makefile @@ -209,7 +209,8 @@ endif build/lib/libluajit-5.1.a: build/$(LUAJIT_TAR) (cd build; tar -xf $(LUAJIT_TAR)) # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 - (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.6) + # see also https://github.com/LuaJIT/LuaJIT/issues/575 + (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7) release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) cp $(LUAJIT_INCLUDE)/$*.h $@ diff --git a/cmake/Modules/GetLuaJIT.cmake b/cmake/Modules/GetLuaJIT.cmake index 328a8cb1..d0348a5a 100644 --- a/cmake/Modules/GetLuaJIT.cmake +++ b/cmake/Modules/GetLuaJIT.cmake @@ -104,7 +104,8 @@ else() OUTPUT ${LUAJIT_STATIC_LIBRARY} ${LUAJIT_SHARED_LIBRARY_PATHS} ${LUAJIT_EXECUTABLE} ${LUAJIT_INSTALL_HEADERS} DEPENDS ${LUAJIT_SOURCE_DIR} # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 - COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.6 + # see also https://github.com/LuaJIT/LuaJIT/issues/575 + COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7 WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} VERBATIM ) From d75cc60860ba2f8ea976cb6279feda47a865a3ac Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:08:30 -0700 Subject: [PATCH 10/30] Try brew versions of LLVM builds, in the hopes that they fix sysroot issue. --- travis.sh | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/travis.sh b/travis.sh index caca2d73..a8d225e3 100755 --- a/travis.sh +++ b/travis.sh @@ -87,29 +87,25 @@ fi if [[ $(uname) = Darwin ]]; then if [[ $LLVM_CONFIG = llvm-config-9 ]]; then - curl -L -O http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz - tar xf clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz - ln -s clang+llvm-9.0.0-x86_64-darwin-apple/bin/llvm-config llvm-config-9 - ln -s clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang clang-9 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-9.0.0-x86_64-darwin-apple + brew install llvm@9 + ln -s "$(brew --prefix)"/opt/llvm@9/bin/llvm-config llvm-config-9 + ln -s "$(brew --prefix)"/opt/llvm@9/bin/clang clang-9 + export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@9 elif [[ $LLVM_CONFIG = llvm-config-8 ]]; then - curl -L -O http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-8.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-8 - ln -s clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang clang-8 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-8.0.0-x86_64-apple-darwin + brew install llvm@8 + ln -s "$(brew --prefix)"/opt/llvm@8/bin/llvm-config llvm-config-8 + ln -s "$(brew --prefix)"/opt/llvm@8/bin/clang clang-8 + export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@8 elif [[ $LLVM_CONFIG = llvm-config-7 ]]; then - curl -L -O http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-7.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-7 - ln -s clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang clang-7 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-7.0.0-x86_64-apple-darwin + brew install llvm@7 + ln -s "$(brew --prefix)"/opt/llvm@7/bin/llvm-config llvm-config-7 + ln -s "$(brew --prefix)"/opt/llvm@7/bin/clang clang-7 + export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@7 elif [[ $LLVM_CONFIG = llvm-config-6.0 ]]; then - curl -L -O http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-6.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-6.0 - ln -s clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang clang-6.0 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-6.0.0-x86_64-apple-darwin + brew install llvm@6 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6 + export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@6 elif [[ $LLVM_CONFIG = llvm-config-5.0 ]]; then curl -L -O http://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz tar xf clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz From d3e5841529c3c8e257aa30e4ac6b45ee5422c6a9 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:09:01 -0700 Subject: [PATCH 11/30] Go back to old include path. --- travis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.sh b/travis.sh index a8d225e3..5497faff 100755 --- a/travis.sh +++ b/travis.sh @@ -143,8 +143,8 @@ if [[ $(uname) = Darwin ]]; then # workaround for https://github.com/terralang/terra/issues/365 # xcode-select --install - # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" - export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include + export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include export PATH=$PWD:$PATH fi From f217a96d6efb58735edb1ece9abfd9b09e7fa378 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:16:34 -0700 Subject: [PATCH 12/30] Fix typo. --- travis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.sh b/travis.sh index 5497faff..d2665287 100755 --- a/travis.sh +++ b/travis.sh @@ -103,8 +103,8 @@ if [[ $(uname) = Darwin ]]; then export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@7 elif [[ $LLVM_CONFIG = llvm-config-6.0 ]]; then brew install llvm@6 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6.0 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6.0 export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@6 elif [[ $LLVM_CONFIG = llvm-config-5.0 ]]; then curl -L -O http://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz From c049d0196f2fd5720e1d272b4e476105393fa45f Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:24:46 -0700 Subject: [PATCH 13/30] Wait, we shouldn't need any INCLUDE_PATH hack... --- travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index d2665287..436942d2 100755 --- a/travis.sh +++ b/travis.sh @@ -143,7 +143,7 @@ if [[ $(uname) = Darwin ]]; then # workaround for https://github.com/terralang/terra/issues/365 # xcode-select --install - export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include export PATH=$PWD:$PATH From b9240c4a45ab25dcabc03f13159613ff05d04fd3 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:29:47 -0700 Subject: [PATCH 14/30] Try higher deployment target. --- Makefile | 2 +- cmake/Modules/GetLuaJIT.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 336e6a82..69484636 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ build/lib/libluajit-5.1.a: build/$(LUAJIT_TAR) (cd build; tar -xf $(LUAJIT_TAR)) # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7) + (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.14) release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) cp $(LUAJIT_INCLUDE)/$*.h $@ diff --git a/cmake/Modules/GetLuaJIT.cmake b/cmake/Modules/GetLuaJIT.cmake index d0348a5a..3539e494 100644 --- a/cmake/Modules/GetLuaJIT.cmake +++ b/cmake/Modules/GetLuaJIT.cmake @@ -105,7 +105,7 @@ else() DEPENDS ${LUAJIT_SOURCE_DIR} # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7 + COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.14 WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} VERBATIM ) From e63f3dfc097697143c6c44b781d7db46fc95f085 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 15:46:33 -0700 Subject: [PATCH 15/30] Try setting explicit path to CC/CXX. --- travis.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/travis.sh b/travis.sh index 436942d2..57dfe5ba 100755 --- a/travis.sh +++ b/travis.sh @@ -146,6 +146,9 @@ if [[ $(uname) = Darwin ]]; then # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include + export CC=$(which $CC) + export CXX=$(which $CXX) + export PATH=$PWD:$PATH fi From d568a2d1c1a8e87c8f24bc3dffd7664bc5345d28 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:02:16 -0700 Subject: [PATCH 16/30] Try to really force CMake to use MY compiler. --- travis.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/travis.sh b/travis.sh index 57dfe5ba..09bc2f3c 100755 --- a/travis.sh +++ b/travis.sh @@ -146,9 +146,6 @@ if [[ $(uname) = Darwin ]]; then # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include - export CC=$(which $CC) - export CXX=$(which $CXX) - export PATH=$PWD:$PATH fi @@ -176,7 +173,7 @@ if [[ $USE_CMAKE -eq 1 ]]; then fi pushd build - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" + cmake .. -DCMAKE_C_COMPILER=$(which $CC) -DCMAKE_CXX_COMPILER=$(which $CXX) -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" make install -j2 ctest -j2 || (test "$(uname)" = "Darwin" && test "$LLVM_CONFIG" = "llvm-config-3.8") popd From 24da0f1d529fd5507af7f9780afd9837f210be7f Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:14:44 -0700 Subject: [PATCH 17/30] Put the INCLUDE_PATH back. --- travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index 09bc2f3c..bddb9edf 100755 --- a/travis.sh +++ b/travis.sh @@ -143,7 +143,7 @@ if [[ $(uname) = Darwin ]]; then # workaround for https://github.com/terralang/terra/issues/365 # xcode-select --install - # export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include export PATH=$PWD:$PATH From 7f13327f15633bb7b000bede4941312c9248bdbf Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:15:13 -0700 Subject: [PATCH 18/30] Get ctest output on failure. --- travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index bddb9edf..c9607499 100755 --- a/travis.sh +++ b/travis.sh @@ -175,7 +175,7 @@ if [[ $USE_CMAKE -eq 1 ]]; then pushd build cmake .. -DCMAKE_C_COMPILER=$(which $CC) -DCMAKE_CXX_COMPILER=$(which $CXX) -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" make install -j2 - ctest -j2 || (test "$(uname)" = "Darwin" && test "$LLVM_CONFIG" = "llvm-config-3.8") + ctest --output-on-failure -j2 || (test "$(uname)" = "Darwin" && test "$LLVM_CONFIG" = "llvm-config-3.8") popd pushd tests From 5f3054a909ceb4beff44b663028ce603fe466c48 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:33:08 -0700 Subject: [PATCH 19/30] Fix test include path. --- tests/dynlib.t | 2 +- tests/exportdynamic.t | 2 +- tests/luaapi.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/dynlib.t b/tests/dynlib.t index 09e725bd..3b106ebf 100644 --- a/tests/dynlib.t +++ b/tests/dynlib.t @@ -1,7 +1,7 @@ local ffi = require 'ffi' -- test that the dynamic library for terra was built correctly -- by compiling a new program that links against it and running it -terralib.includepath = terralib.terrahome.."/include/terra" +terralib.includepath = terralib.includepath .. ";" .. terralib.terrahome .. "/include/terra" C = terralib.includecstring [[ #include #include "terra.h" diff --git a/tests/exportdynamic.t b/tests/exportdynamic.t index 3bbd63b3..0583823f 100644 --- a/tests/exportdynamic.t +++ b/tests/exportdynamic.t @@ -1,4 +1,4 @@ -terralib.includepath = terralib.terrahome.."/include/terra" +terralib.includepath = terralib.includepath .. ";" .. terralib.terrahome .. "/include/terra" C = terralib.includecstring [[ #include "lua.h" #include "lauxlib.h" diff --git a/tests/luaapi.t b/tests/luaapi.t index 10a69360..f615d427 100644 --- a/tests/luaapi.t +++ b/tests/luaapi.t @@ -1,4 +1,4 @@ -terralib.includepath = terralib.terrahome.."/include/terra" +terralib.includepath = terralib.includepath .. ";" .. terralib.terrahome .. "/include/terra" C = terralib.includecstring [[ #include "lua.h" #include "lauxlib.h" From 9d8ff1b421d5373d5629c7965010a81100be350a Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:33:16 -0700 Subject: [PATCH 20/30] Refactor macOS hack. --- travis.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index c9607499..87c18024 100755 --- a/travis.sh +++ b/travis.sh @@ -171,9 +171,18 @@ if [[ $USE_CMAKE -eq 1 ]]; then -DTERRA_SLIB_INCLUDE_LUAJIT=OFF ) fi + if [[ $(uname) = Darwin ]]; then + # Hack: CMake tries to be smart and use XCode's copy of Clang by + # default. This causes LuaJIT to not build on Mojave and later + # (math.h not found) if the header package is not installed. + CMAKE_FLAGS+=( + -DCMAKE_C_COMPILER=$(which $CC) + -DCMAKE_CXX_COMPILER=$(which $CXX) + ) + fi pushd build - cmake .. -DCMAKE_C_COMPILER=$(which $CC) -DCMAKE_CXX_COMPILER=$(which $CXX) -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" + cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" make install -j2 ctest --output-on-failure -j2 || (test "$(uname)" = "Darwin" && test "$LLVM_CONFIG" = "llvm-config-3.8") popd From 2e5d1a6318a9eb925eda4f15ef5c4b96869fb210 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 16:50:24 -0700 Subject: [PATCH 21/30] Cast objc_msgSend to work around header type. --- tests/lib/objc.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/lib/objc.t b/tests/lib/objc.t index c3758645..82e476be 100644 --- a/tests/lib/objc.t +++ b/tests/lib/objc.t @@ -14,13 +14,18 @@ local mangleSelector --replace methods such as: myobj:methodcall(arg0,arg1) --with calls to the objc runtime api: objc_msgSend(&obj,sel_registerName("methodcall"),arg0,arg1) +-- Hack: As of macOS 10.15 this type signature has changed, see: +-- https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.html +local objc_msgSend_type = terralib.types.funcpointer( + {&C.objc_object, &C.objc_selector}, &C.objc_object, true) + local struct Wrapper { data : &C.objc_object } Wrapper.metamethods.__methodmissing = macro(function(sel,obj,...) local arguments = {...} sel = mangleSelector(sel,#arguments) - return `Wrapper { C.objc_msgSend(obj.data,C.sel_registerName(sel),arguments) } + return `Wrapper { ([objc_msgSend_type](C.objc_msgSend))(obj.data,C.sel_registerName(sel),arguments) } end) function mangleSelector(sel,nargs) From 8569f76d28f3c364ba0ea8e6b08ebe36e619f4af Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:00:40 -0700 Subject: [PATCH 22/30] Revert "Fix typo." This reverts commit f217a96d6efb58735edb1ece9abfd9b09e7fa378. --- travis.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.sh b/travis.sh index 87c18024..f2d28b06 100755 --- a/travis.sh +++ b/travis.sh @@ -103,8 +103,8 @@ if [[ $(uname) = Darwin ]]; then export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@7 elif [[ $LLVM_CONFIG = llvm-config-6.0 ]]; then brew install llvm@6 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6.0 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6.0 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6 + ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6 export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@6 elif [[ $LLVM_CONFIG = llvm-config-5.0 ]]; then curl -L -O http://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz From 760f0f567dac82680722729b8ce65d0fefabf534 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:00:55 -0700 Subject: [PATCH 23/30] Revert "Try brew versions of LLVM builds, in the hopes that they fix sysroot issue." This reverts commit d75cc60860ba2f8ea976cb6279feda47a865a3ac. --- travis.sh | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/travis.sh b/travis.sh index f2d28b06..55b2da7e 100755 --- a/travis.sh +++ b/travis.sh @@ -87,25 +87,29 @@ fi if [[ $(uname) = Darwin ]]; then if [[ $LLVM_CONFIG = llvm-config-9 ]]; then - brew install llvm@9 - ln -s "$(brew --prefix)"/opt/llvm@9/bin/llvm-config llvm-config-9 - ln -s "$(brew --prefix)"/opt/llvm@9/bin/clang clang-9 - export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@9 + curl -L -O http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz + tar xf clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz + ln -s clang+llvm-9.0.0-x86_64-darwin-apple/bin/llvm-config llvm-config-9 + ln -s clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang clang-9 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-9.0.0-x86_64-darwin-apple elif [[ $LLVM_CONFIG = llvm-config-8 ]]; then - brew install llvm@8 - ln -s "$(brew --prefix)"/opt/llvm@8/bin/llvm-config llvm-config-8 - ln -s "$(brew --prefix)"/opt/llvm@8/bin/clang clang-8 - export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@8 + curl -L -O http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz + tar xf clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz + ln -s clang+llvm-8.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-8 + ln -s clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang clang-8 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-8.0.0-x86_64-apple-darwin elif [[ $LLVM_CONFIG = llvm-config-7 ]]; then - brew install llvm@7 - ln -s "$(brew --prefix)"/opt/llvm@7/bin/llvm-config llvm-config-7 - ln -s "$(brew --prefix)"/opt/llvm@7/bin/clang clang-7 - export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@7 + curl -L -O http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz + tar xf clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz + ln -s clang+llvm-7.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-7 + ln -s clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang clang-7 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-7.0.0-x86_64-apple-darwin elif [[ $LLVM_CONFIG = llvm-config-6.0 ]]; then - brew install llvm@6 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/llvm-config llvm-config-6 - ln -s "$(brew --prefix)"/opt/llvm@6/bin/clang clang-6 - export CMAKE_PREFIX_PATH="$(brew --prefix)"/opt/llvm@6 + curl -L -O http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz + tar xf clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz + ln -s clang+llvm-6.0.0-x86_64-apple-darwin/bin/llvm-config llvm-config-6.0 + ln -s clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang clang-6.0 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-6.0.0-x86_64-apple-darwin elif [[ $LLVM_CONFIG = llvm-config-5.0 ]]; then curl -L -O http://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz tar xf clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz From b6e434f8aad651f9576d16410d63d20df6554075 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:01:13 -0700 Subject: [PATCH 24/30] Revert "Try higher deployment target." This reverts commit b9240c4a45ab25dcabc03f13159613ff05d04fd3. --- Makefile | 2 +- cmake/Modules/GetLuaJIT.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 69484636..336e6a82 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ build/lib/libluajit-5.1.a: build/$(LUAJIT_TAR) (cd build; tar -xf $(LUAJIT_TAR)) # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.14) + (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7) release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) cp $(LUAJIT_INCLUDE)/$*.h $@ diff --git a/cmake/Modules/GetLuaJIT.cmake b/cmake/Modules/GetLuaJIT.cmake index 3539e494..d0348a5a 100644 --- a/cmake/Modules/GetLuaJIT.cmake +++ b/cmake/Modules/GetLuaJIT.cmake @@ -105,7 +105,7 @@ else() DEPENDS ${LUAJIT_SOURCE_DIR} # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.14 + COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7 WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} VERBATIM ) From 8a5a17f596a992b22000c6eac6f0a2a5c44ab198 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:02:35 -0700 Subject: [PATCH 25/30] Cleanup. --- travis.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/travis.sh b/travis.sh index 55b2da7e..aa31c6e0 100755 --- a/travis.sh +++ b/travis.sh @@ -142,13 +142,8 @@ if [[ $(uname) = Darwin ]]; then hdiutil detach /Volumes/CUDAMacOSXInstaller fi - # # Hack: Seems the package isn't signed on some versions of macOS? - # sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / -allowUntrusted - # workaround for https://github.com/terralang/terra/issues/365 - # xcode-select --install export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" - # export INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include export PATH=$PWD:$PATH fi From bf0b4d6fa1e19c43952c47851dc90d6e1688634f Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:04:01 -0700 Subject: [PATCH 26/30] Avoid spew. --- travis.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/travis.sh b/travis.sh index aa31c6e0..fb7480d6 100755 --- a/travis.sh +++ b/travis.sh @@ -186,9 +186,12 @@ if [[ $USE_CMAKE -eq 1 ]]; then ctest --output-on-failure -j2 || (test "$(uname)" = "Darwin" && test "$LLVM_CONFIG" = "llvm-config-3.8") popd - pushd tests - ../install/bin/terra ./run - popd + # Skip this on macOS because it spews too much on Mojave and newer. + if [[ $(uname) != Darwin ]]; then + pushd tests + ../install/bin/terra ./run + popd + fi else make LLVM_CONFIG=$(which $LLVM_CONFIG) CLANG=$(which $CLANG) test From 70354f70a89df7d4d657f1e2c79122155803bcba Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 17:08:49 -0700 Subject: [PATCH 27/30] Fiddle with macOS test matrix. --- .travis.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10eb8440..94f75443 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: cpp sudo: required dist: xenial -osx_image: xcode11.3 # macOS 10.14 os: - linux - - osx compiler: - gcc - clang @@ -39,20 +37,32 @@ jobs: env: DOCKER_BUILD=ubuntu-18.04 - os: linux env: DOCKER_BUILD=ubuntu-19.10 - exclude: - # Various macOS tests seem to be broken. + + # macOS tests - os: osx - compiler: gcc + osx_image: xcode10.1 # macOS 10.13 + compiler: clang + env: LLVM_CONFIG=llvm-config-3.5 CLANG=clang-3.5 - os: osx - env: LLVM_CONFIG=llvm-config-5.0 CLANG=clang-5.0 USE_CMAKE=1 + osx_image: xcode10.1 # macOS 10.13 + compiler: clang + env: LLVM_CONFIG=llvm-config-3.8 CLANG=clang-3.8 - os: osx - env: LLVM_CONFIG=llvm-config-6.0 CLANG=clang-6.0 USE_CMAKE=1 STATIC_LLVM=0 STATIC_LUAJIT=0 + osx_image: xcode11.3 # macOS 10.14 + compiler: clang + env: LLVM_CONFIG=llvm-config-6.0 CLANG=clang-6.0 USE_CMAKE=1 - os: osx - env: LLVM_CONFIG=llvm-config-8 CLANG=clang-8 + osx_image: xcode11.3 # macOS 10.14 + compiler: clang + env: LLVM_CONFIG=llvm-config-7 CLANG=clang-7 USE_CMAKE=1 - os: osx - env: LLVM_CONFIG=llvm-config-9 CLANG=clang-9 + osx_image: xcode11.3 # macOS 10.14 + compiler: clang + env: LLVM_CONFIG=llvm-config-8 CLANG=clang-8 USE_CMAKE=1 - os: osx - env: LLVM_CONFIG=llvm-config-9 CLANG=clang-9 USE_CMAKE=1 STATIC_LLVM=0 STATIC_LUAJIT=0 + osx_image: xcode11.3 # macOS 10.14 + compiler: clang + env: LLVM_CONFIG=llvm-config-9 CLANG=clang-9 USE_CMAKE=1 script: - ./travis.sh From 30ca3ed6c9b65ef92d95e367a10a0903401e06e4 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 21:17:32 -0700 Subject: [PATCH 28/30] Avoid modifying INCLUDE_PATH if /usr/include still exists, to avoid spew in output. --- travis.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/travis.sh b/travis.sh index fb7480d6..2a5cd83e 100755 --- a/travis.sh +++ b/travis.sh @@ -143,7 +143,9 @@ if [[ $(uname) = Darwin ]]; then fi # workaround for https://github.com/terralang/terra/issues/365 - export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + if [[ ! -e /usr/include ]]; then + export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include" + fi export PATH=$PWD:$PATH fi @@ -175,8 +177,8 @@ if [[ $USE_CMAKE -eq 1 ]]; then # default. This causes LuaJIT to not build on Mojave and later # (math.h not found) if the header package is not installed. CMAKE_FLAGS+=( - -DCMAKE_C_COMPILER=$(which $CC) - -DCMAKE_CXX_COMPILER=$(which $CXX) + -DCMAKE_C_COMPILER=$(which $CC) + -DCMAKE_CXX_COMPILER=$(which $CXX) ) fi From c589806ddaed0fcf365ac37d74e067791c0f8229 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 21:25:20 -0700 Subject: [PATCH 29/30] Try alternative to CMake CC workaround. --- Makefile | 8 +++++++- cmake/Modules/GetLuaJIT.cmake | 11 ++++++++++- travis.sh | 9 --------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 336e6a82..e38b946e 100644 --- a/Makefile +++ b/Makefile @@ -206,11 +206,17 @@ else wget $(LUAJIT_URL) -O build/$(LUAJIT_TAR) endif +ifeq ($(UNAME), Darwin) +MACOSX_DEPLOYMENT_TARGET=$(shell xcrun --sdk macosx --show-sdk-version) +else +MACOSX_DEPLOYMENT_TARGET= +endif + build/lib/libluajit-5.1.a: build/$(LUAJIT_TAR) (cd build; tar -xf $(LUAJIT_TAR)) # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7) + (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)) release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) cp $(LUAJIT_INCLUDE)/$*.h $@ diff --git a/cmake/Modules/GetLuaJIT.cmake b/cmake/Modules/GetLuaJIT.cmake index d0348a5a..754996e5 100644 --- a/cmake/Modules/GetLuaJIT.cmake +++ b/cmake/Modules/GetLuaJIT.cmake @@ -100,12 +100,21 @@ if(WIN32) ) endforeach() else() + if(APPLE) + execute_process( + COMMAND xcrun --sdk macosx --show-sdk-version + OUTPUT_VARIABLE MACOSX_DEPLOYMENT_TARGET + ) + else() + set(MACOSX_DEPLOYMENT_TARGET "") + endif() + add_custom_command( OUTPUT ${LUAJIT_STATIC_LIBRARY} ${LUAJIT_SHARED_LIBRARY_PATHS} ${LUAJIT_EXECUTABLE} ${LUAJIT_INSTALL_HEADERS} DEPENDS ${LUAJIT_SOURCE_DIR} # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7 + COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} VERBATIM ) diff --git a/travis.sh b/travis.sh index 2a5cd83e..2021984f 100755 --- a/travis.sh +++ b/travis.sh @@ -172,15 +172,6 @@ if [[ $USE_CMAKE -eq 1 ]]; then -DTERRA_SLIB_INCLUDE_LUAJIT=OFF ) fi - if [[ $(uname) = Darwin ]]; then - # Hack: CMake tries to be smart and use XCode's copy of Clang by - # default. This causes LuaJIT to not build on Mojave and later - # (math.h not found) if the header package is not installed. - CMAKE_FLAGS+=( - -DCMAKE_C_COMPILER=$(which $CC) - -DCMAKE_CXX_COMPILER=$(which $CXX) - ) - fi pushd build cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}" From 3ede6d0070ba5adbcb676ca07ddc287a5b9003ec Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 21 Apr 2020 21:37:26 -0700 Subject: [PATCH 30/30] Revert "Try alternative to CMake CC workaround." This reverts commit c589806ddaed0fcf365ac37d74e067791c0f8229. --- Makefile | 8 +------- cmake/Modules/GetLuaJIT.cmake | 11 +---------- travis.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index e38b946e..336e6a82 100644 --- a/Makefile +++ b/Makefile @@ -206,17 +206,11 @@ else wget $(LUAJIT_URL) -O build/$(LUAJIT_TAR) endif -ifeq ($(UNAME), Darwin) -MACOSX_DEPLOYMENT_TARGET=$(shell xcrun --sdk macosx --show-sdk-version) -else -MACOSX_DEPLOYMENT_TARGET= -endif - build/lib/libluajit-5.1.a: build/$(LUAJIT_TAR) (cd build; tar -xf $(LUAJIT_TAR)) # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)) + (cd $(LUAJIT_DIR); $(MAKE) install PREFIX=$(realpath build) CC=$(CC) STATIC_CC="$(CC) -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7) release/include/terra/%.h: $(LUAJIT_INCLUDE)/%.h $(LUAJIT_LIB) cp $(LUAJIT_INCLUDE)/$*.h $@ diff --git a/cmake/Modules/GetLuaJIT.cmake b/cmake/Modules/GetLuaJIT.cmake index 754996e5..d0348a5a 100644 --- a/cmake/Modules/GetLuaJIT.cmake +++ b/cmake/Modules/GetLuaJIT.cmake @@ -100,21 +100,12 @@ if(WIN32) ) endforeach() else() - if(APPLE) - execute_process( - COMMAND xcrun --sdk macosx --show-sdk-version - OUTPUT_VARIABLE MACOSX_DEPLOYMENT_TARGET - ) - else() - set(MACOSX_DEPLOYMENT_TARGET "") - endif() - add_custom_command( OUTPUT ${LUAJIT_STATIC_LIBRARY} ${LUAJIT_SHARED_LIBRARY_PATHS} ${LUAJIT_EXECUTABLE} ${LUAJIT_INSTALL_HEADERS} DEPENDS ${LUAJIT_SOURCE_DIR} # MACOSX_DEPLOYMENT_TARGET is a workaround for https://github.com/LuaJIT/LuaJIT/issues/484 # see also https://github.com/LuaJIT/LuaJIT/issues/575 - COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} + COMMAND make install "PREFIX=${LUAJIT_INSTALL_PREFIX}" "CC=${CMAKE_C_COMPILER}" "STATIC_CC=${CMAKE_C_COMPILER} -fPIC" MACOSX_DEPLOYMENT_TARGET=10.7 WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} VERBATIM ) diff --git a/travis.sh b/travis.sh index 2021984f..2a5cd83e 100755 --- a/travis.sh +++ b/travis.sh @@ -172,6 +172,15 @@ if [[ $USE_CMAKE -eq 1 ]]; then -DTERRA_SLIB_INCLUDE_LUAJIT=OFF ) fi + if [[ $(uname) = Darwin ]]; then + # Hack: CMake tries to be smart and use XCode's copy of Clang by + # default. This causes LuaJIT to not build on Mojave and later + # (math.h not found) if the header package is not installed. + CMAKE_FLAGS+=( + -DCMAKE_C_COMPILER=$(which $CC) + -DCMAKE_CXX_COMPILER=$(which $CXX) + ) + fi pushd build cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install "${CMAKE_FLAGS[@]}"