[tarantool-patches] [tarantool-patches] [PATCH 1/1] travis-ci: fixed Mojave mac build with CMAKE_OSX_DEPLOYMENT_TARGET
Alexander Tikhonov
avtikhon at tarantool.org
Tue Feb 19 17:05:35 MSK 2019
1. Changed the Travis-CI testing default OSX image from 'xcode9' to 'xcode10.1',
also added Travis-CI's default 'xcode9.4' image to the '2.1' branch testing.
2. Corrected virtualenv setup for OSX images where it is not installed by default.
3. Corrected the minimum version of OSX image on which the target binaries are to be
deployed. CMake uses this value for the -mmacosx-version-min flag and to help choose the
default SDK. The CMAKE_OSX_DEPLOYMENT_TARGET depends on DARWIN_VERSION:
DARWIN_VERSION <= 10.12 -> CMAKE_OSX_DEPLOYMENT_TARGET = 10.6
DARWIN_VERSION >= 10.13 -> CMAKE_OSX_DEPLOYMENT_TARGET = 10.14
Closes #3797
---
Travis-CI: https://travis-ci.org/tarantool/tarantool/builds/495448673
Travis-CI(checked all OSX): https://travis-ci.org/tarantool/tarantool/builds/495415195
Branch: https://github.com/tarantool/tarantool/tree/remotes/origin/avtikhon/gh-3797-fix-mojave-mac-build
diff --git a/.travis.mk b/.travis.mk
index edd94cd7d..181bab438 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -47,6 +47,10 @@ test_ubuntu: deps_ubuntu
deps_osx:
brew update
brew install openssl readline curl icu4c --force
+ virtualenv -h >/dev/null 2>&1 || \
+ ( pip -h >/dev/null 2>&1 || ( curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python && pip --version ) && \
+ brew install pyenv-virtualenv --force && \
+ pip install virtualenv )
test_osx: deps_osx
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfoWError ${CMAKE_EXTRA_PARAMS}
diff --git a/.travis.yml b/.travis.yml
index ffe2e8247..e03bd3185 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@ language: cpp
os: linux
compiler: gcc
-osx_image: xcode9
+osx_image: xcode10.1
cache:
directories:
@@ -27,6 +27,11 @@ jobs:
- name: RelWithDebInfoWError build + test (OS X)
env: TARGET=test
os: osx
+ - name: RelWithDebInfoWError build + test (OS X 9.4)
+ env: TARGET=test
+ os: osx
+ osx_image: xcode9.4
+ if: branch = "2.1"
- name: Debug build + test + coverage (Linux, gcc)
env: TARGET=coverage
- name: LTO build + test (Linux, gcc)
diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake
index ea4878a93..d2253a0f9 100644
--- a/cmake/luajit.cmake
+++ b/cmake/luajit.cmake
@@ -194,9 +194,28 @@ macro(luajit_build)
endif()
# Pass deployment target
if ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
- # Default to 10.6 since @rpath support is NOT available in
- # earlier versions, needed by AddressSanitizer.
- set (luajit_osx_deployment_target 10.6)
+ # DARWIN_VERSION <= 10.12 -> CMAKE_OSX_DEPLOYMENT_TARGET = 10.6
+ # DARWIN_VERSION >= 10.13 -> CMAKE_OSX_DEPLOYMENT_TARGET = 10.14
+ execute_process(COMMAND sw_vers -productVersion
+ OUTPUT_VARIABLE PRODUCT_VERSION)
+ message(STATUS "PRODUCT_VERSION=${PRODUCT_VERSION}")
+ string(REGEX MATCH "[0-9]+.[0-9]+" DARWIN_VERSION ${PRODUCT_VERSION})
+ message(STATUS "DARWIN_VERSION=${DARWIN_VERSION}")
+ string(REGEX MATCH "^[0-9]+" MAJOR_VERSION ${DARWIN_VERSION})
+ message(STATUS "MAJOR_VERSION=${MAJOR_VERSION}")
+ if (MAJOR_VERSION GREATER 10)
+ set (luajit_osx_deployment_target 10.14)
+ elseif (MAJOR_VERSION LESS 10)
+ set (luajit_osx_deployment_target 10.6)
+ elseif (MAJOR_VERSION EQUAL 10)
+ string(REGEX MATCH "[0-9]+$" MINOR_VERSION ${DARWIN_VERSION})
+ message(STATUS "MINOR_VERSION=${MINOR_VERSION}")
+ if (MINOR_VERSION GREATER 12)
+ set (luajit_osx_deployment_target 10.14)
+ else ()
+ set (luajit_osx_deployment_target 10.6)
+ endif ()
+ endif ()
else()
set (luajit_osx_deployment_target ${CMAKE_OSX_DEPLOYMENT_TARGET})
endif()
--
Alexander Tikhonov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190219/36b002c3/attachment.html>
More information about the Tarantool-patches
mailing list