summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake8
-rw-r--r--Modules/CPackRPM.cmake6
-rw-r--r--Modules/Compiler/Intel-C.cmake9
-rw-r--r--Modules/Compiler/Intel-CXX-FeatureTests.cmake6
-rw-r--r--Modules/Compiler/Intel-CXX.cmake9
-rw-r--r--Modules/FindHDF5.cmake12
-rw-r--r--Modules/FindMatlab.cmake3
-rw-r--r--Modules/MatlabTestsRedirect.cmake4
-rw-r--r--Modules/Platform/Android-Common.cmake4
-rw-r--r--Modules/Platform/Android/abi-arm64-v8a-Clang.cmake5
-rw-r--r--Modules/Platform/Android/abi-arm64-v8a-GNU.cmake6
-rw-r--r--Modules/Platform/Android/abi-armeabi-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v6-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v6-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-common.cmake15
-rw-r--r--Modules/Platform/Android/abi-mips-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-mips-GNU.cmake3
-rw-r--r--Modules/Platform/Android/abi-mips64-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-mips64-GNU.cmake3
-rw-r--r--Modules/Platform/Android/abi-x86-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-x86_64-Clang.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-c++_static.cmake2
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake8
-rw-r--r--Modules/Platform/Darwin.cmake24
27 files changed, 56 insertions, 93 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 653283c..909a12b 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -32,11 +32,11 @@
# - https://cmake.org/Wiki/CMake:CPackConfiguration
# - https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
#
-# List of CPackRPM specific variables:
+# List of CPackDEB specific variables:
#
-# .. variable:: CPACK_DEB_PACKAGE_COMPONENT
+# .. variable:: CPACK_DEB_COMPONENT_INSTALL
#
-# Enable component packaging for CPackRPM
+# Enable component packaging for CPackDEB
#
# * Mandatory : NO
# * Default : OFF
@@ -616,7 +616,7 @@ function(cpack_deb_prepare_package_vars)
find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
if(SHLIBDEPS_EXECUTABLE)
- # Check version of the dpkg-shlibdeps tool using CPackRPM method
+ # Check version of the dpkg-shlibdeps tool using CPackDEB method
execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 15b62c7..0640630 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -45,7 +45,7 @@
#
# List of CPackRPM specific variables:
#
-# .. variable:: CPACK_RPM_PACKAGE_COMPONENT
+# .. variable:: CPACK_RPM_COMPONENT_INSTALL
#
# Enable component packaging for CPackRPM
#
@@ -461,7 +461,7 @@
# May be used to embed a pre (un)installation script in the spec file.
# The referred script file (or both) will be read and directly
# put after the ``%pre`` or ``%preun`` section
-# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install
+# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
# script for each component can be overridden with
# ``CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE`` and
# ``CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE``.
@@ -480,7 +480,7 @@
# May be used to embed a post (un)installation script in the spec file.
# The referred script file (or both) will be read and directly
# put after the ``%post`` or ``%postun`` section.
-# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install
+# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
# script for each component can be overridden with
# ``CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE`` and
# ``CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE``.
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index 1d09bd5..61adf40 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -9,20 +9,22 @@ set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <OBJECT> -MF <DEPFILE>")
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
set(_std -Qstd)
+ set(_ext c)
else()
set(_std -std)
+ set(_ext gnu)
endif()
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "${_std}=c11")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=gnu11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=${_ext}11")
endif()
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "${_std}=c89")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=gnu89")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=${_ext}89")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "${_std}=c99")
- set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=gnu99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=${_ext}99")
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1)
@@ -42,6 +44,7 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1)
endif()
unset(_std)
+unset(_ext)
macro(cmake_record_c_compile_features)
macro(_get_intel_c_features std_version list)
diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
index e111c07..57a05c8 100644
--- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
@@ -1,6 +1,7 @@
# References:
# - https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
# - https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler
+# - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0096r3.html
# FIXME: Intel C++ feature detection works only when simulating the GNU compiler.
# When simulating MSVC, Intel always sets __cplusplus to 199711L.
@@ -8,9 +9,8 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
return()
endif()
-# these are not implemented in any version at time of writing
-#set(_cmake_feature_test_cxx_variable_templates "${Intel15_CXX14}")
-#set(_cmake_feature_test_cxx_relaxed_constexpr "${Intel15_CXX14}")
+set(_cmake_feature_test_cxx_variable_templates "__cpp_variable_templates >= 201304")
+set(_cmake_feature_test_cxx_relaxed_constexpr "__cpp_constexpr >= 201304")
set(_cmake_oldestSupported "__INTEL_COMPILER >= 1210")
set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || defined(__GXX_EXPERIMENTAL_CXX0X__))")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 3cc4503..73dd7fa 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -9,8 +9,10 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(_std -Qstd)
+ set(_ext c++)
else()
set(_std -std)
+ set(_ext gnu++)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
@@ -25,15 +27,15 @@ endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "${_std}=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=gnu++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=${_ext}11")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "${_std}=c++0x")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=gnu++0x")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=${_ext}0x")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=gnu++98")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=${_ext}98")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
@@ -50,6 +52,7 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
endif()
unset(_std)
+unset(_ext)
macro(cmake_record_cxx_compile_features)
macro(_get_intel_features std_version list)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 1c2c443..16764e0 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -100,18 +100,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
set(HDF5_VALID_LANGUAGE_BINDINGS C CXX Fortran)
# Validate the list of find components.
-set(HDF5_LANGUAGE_BINDINGS)
if(NOT HDF5_FIND_COMPONENTS)
- get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES)
- foreach(__lang IN LISTS __langs)
- if(__lang MATCHES "^(C|CXX|Fortran)$")
- list(APPEND HDF5_LANGUAGE_BINDINGS ${__lang})
- set(HDF5_FIND_REQUIRED_${__lang} True)
- endif()
- endforeach()
- set(FIND_HL ON)
- set(HDF5_FIND_REQUIRED_HL True)
+ set(HDF5_LANGUAGE_BINDINGS "C")
else()
+ set(HDF5_LANGUAGE_BINDINGS)
# add the extra specified components, ensuring that they are valid.
set(FIND_HL OFF)
foreach(component IN LISTS HDF5_FIND_COMPONENTS)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index b7f2db5..eae1585 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -225,6 +225,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS)
endif()
set(MATLAB_VERSIONS_MAPPING
+ "R2016b=9.1"
"R2016a=9.0"
"R2015b=8.6"
"R2015a=8.5"
@@ -793,7 +794,7 @@ function(matlab_add_unit_test)
"-Dworking_directory=${${prefix}_WORKING_DIRECTORY}"
"-DMatlab_PROGRAM=${Matlab_MAIN_PROGRAM}"
"-Dno_unittest_framework=${${prefix}_NO_UNITTEST_FRAMEWORK}"
- "-DMatlab_ADDITIONNAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}"
+ "-DMatlab_ADDITIONAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}"
"-Dunittest_file_to_run=${${prefix}_UNITTEST_FILE}"
"-Dcustom_Matlab_test_command=${${prefix}_CUSTOM_TEST_COMMAND}"
"-Dcmd_to_run_before_test=${${prefix}_UNITTEST_PRECOMMAND}"
diff --git a/Modules/MatlabTestsRedirect.cmake b/Modules/MatlabTestsRedirect.cmake
index a0c6621..64d580d 100644
--- a/Modules/MatlabTestsRedirect.cmake
+++ b/Modules/MatlabTestsRedirect.cmake
@@ -10,14 +10,14 @@
# -Dadditional_paths=""
# -Dno_unittest_framework=""
# -DMatlab_PROGRAM=matlab_exe_location
-# -DMatlab_ADDITIONNAL_STARTUP_OPTIONS=""
+# -DMatlab_ADDITIONAL_STARTUP_OPTIONS=""
# -Dtest_name=name_of_the_test
# -Dcustom_Matlab_test_command=""
# -Dcmd_to_run_before_test=""
# -Dunittest_file_to_run
# -P FindMatlab_TestsRedirect.cmake
-set(Matlab_UNIT_TESTS_CMD -nosplash -nodesktop -nodisplay ${Matlab_ADDITIONNAL_STARTUP_OPTIONS})
+set(Matlab_UNIT_TESTS_CMD -nosplash -nodesktop -nodisplay ${Matlab_ADDITIONAL_STARTUP_OPTIONS})
if(WIN32)
set(Matlab_UNIT_TESTS_CMD ${Matlab_UNIT_TESTS_CMD} -wait)
endif()
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index 6544696..8755d4f 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -107,6 +107,7 @@ set(_ANDROID_ABI_INIT_CFLAGS "")
set(_ANDROID_ABI_INIT_CFLAGS_DEBUG "")
set(_ANDROID_ABI_INIT_CFLAGS_RELEASE "")
set(_ANDROID_ABI_INIT_LDFLAGS "")
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS "")
macro(__android_compiler_common lang)
if(_ANDROID_ABI_INIT_CFLAGS)
@@ -125,6 +126,9 @@ macro(__android_compiler_common lang)
string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_LDFLAGS}")
endforeach()
endif()
+ if(_ANDROID_ABI_INIT_EXE_LDFLAGS)
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_EXE_LDFLAGS}")
+ endif()
if(DEFINED _ANDROID_STL_EXCEPTIONS)
if(_ANDROID_STL_EXCEPTIONS)
diff --git a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
index 3ff1fe5..f4717d5 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
@@ -1,8 +1,7 @@
# <ndk>/build/core/toolchains/aarch64-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "aarch64-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
+# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
index 538ec2f..b71a674 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
@@ -1,6 +1,6 @@
# <ndk>/build/core/toolchains/aarch64-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
+
+# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-Clang.cmake b/Modules/Platform/Android/abi-armeabi-Clang.cmake
index 4fc3009..b857bd3 100644
--- a/Modules/Platform/Android/abi-armeabi-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-Clang.cmake
@@ -14,7 +14,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -msoft-float"
" -mtune=xscale"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-GNU.cmake b/Modules/Platform/Android/abi-armeabi-GNU.cmake
index 10cac00..33e8b31 100644
--- a/Modules/Platform/Android/abi-armeabi-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-GNU.cmake
@@ -12,7 +12,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -msoft-float"
" -mtune=xscale"
- " -fpic"
)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
index 15f1d4a..a7412f5 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
@@ -13,7 +13,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
index 7492de0..1fda184 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
@@ -11,7 +11,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
index 3a3efb3..e2ab58b 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
@@ -23,7 +23,6 @@ string(APPEND _ANDROID_ABI_INIT_LDFLAGS
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
index d27e37e..b7c328d 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
@@ -17,7 +17,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
string(APPEND _ANDROID_ABI_INIT_LDFLAGS
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 12d8e5c..3b0eb01 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -2,3 +2,18 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -funwind-tables"
" -no-canonical-prefixes"
)
+
+if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
+ AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 16)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
+
+if(CMAKE_POSITION_INDEPENDENT_CODE)
+ string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
+endif()
+
+string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
+
+if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
+ string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,-z,nocopyreloc")
+endif()
diff --git a/Modules/Platform/Android/abi-mips-Clang.cmake b/Modules/Platform/Android/abi-mips-Clang.cmake
index bf6b9fc..73addde 100644
--- a/Modules/Platform/Android/abi-mips-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/mipsel-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "mipsel-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips-GNU.cmake b/Modules/Platform/Android/abi-mips-GNU.cmake
index d380440..982ad46 100644
--- a/Modules/Platform/Android/abi-mips-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips-GNU.cmake
@@ -1,6 +1,3 @@
# <ndk>/build/core/toolchains/mipsel-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-mips64-Clang.cmake b/Modules/Platform/Android/abi-mips64-Clang.cmake
index 1a94107..603f1b2 100644
--- a/Modules/Platform/Android/abi-mips64-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips64-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/mips64el-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "mips64el-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips64-GNU.cmake b/Modules/Platform/Android/abi-mips64-GNU.cmake
index 4525d40..a1bc2c2 100644
--- a/Modules/Platform/Android/abi-mips64-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips64-GNU.cmake
@@ -1,6 +1,3 @@
# <ndk>/build/core/toolchains/mips64el-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-x86-Clang.cmake b/Modules/Platform/Android/abi-x86-Clang.cmake
index f63ed36..fe7eace 100644
--- a/Modules/Platform/Android/abi-x86-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/x86-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "i686-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fPIC"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-x86_64-Clang.cmake b/Modules/Platform/Android/abi-x86_64-Clang.cmake
index c15042b..3cbcd49 100644
--- a/Modules/Platform/Android/abi-x86_64-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86_64-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/x86_64-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "x86_64-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fPIC"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/ndk-stl-c++_static.cmake b/Modules/Platform/Android/ndk-stl-c++_static.cmake
index 8e562f8..061a5c2 100644
--- a/Modules/Platform/Android/ndk-stl-c++_static.cmake
+++ b/Modules/Platform/Android/ndk-stl-c++_static.cmake
@@ -3,4 +3,6 @@ macro(__android_stl lang)
__android_stl_cxx(${lang} libc++_static.a)
__android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libc++abi.a" 0)
__android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libandroid_support.a" 0)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libunwind.a" 0)
+ string(APPEND CMAKE_${lang}_STANDARD_LIBRARIES " -latomic") # provided by toolchain
endmacro()
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 39374e1..b539e45 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -113,7 +113,6 @@ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT
"The product will be built against the headers and libraries located inside the indicated SDK.")
# Transform the cached value to something we can use.
-set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}")
set(_CMAKE_OSX_SYSROOT_PATH "")
if(CMAKE_OSX_SYSROOT)
if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")
@@ -122,13 +121,10 @@ if(CMAKE_OSX_SYSROOT)
message(WARNING "Ignoring CMAKE_OSX_SYSROOT value:\n ${CMAKE_OSX_SYSROOT}\n"
"because the directory does not exist.")
set(CMAKE_OSX_SYSROOT "")
- set(_CMAKE_OSX_SYSROOT_ORIG "")
endif()
set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
- endif()
-
- if(CMAKE_OSX_SYSROOT)
- # Transform the (maybe unversioned) sysroot into a versioned path.
+ else()
+ # Transform the sdk name into a path.
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
OUTPUT_VARIABLE _stdout
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index bb085ac..26b12a1 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -64,30 +64,6 @@ if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
endif()
-# Make sure the combination of SDK and Deployment Target are allowed
-if(CMAKE_OSX_DEPLOYMENT_TARGET)
- if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk")
- set(_sdk_ver "${CMAKE_MATCH_1}")
- elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$")
- set(_sdk_ver "${CMAKE_MATCH_1}")
- elseif("${_CMAKE_OSX_SYSROOT_ORIG}" STREQUAL "/")
- set(_sdk_ver "${_CURRENT_OSX_VERSION}")
- else()
- message(FATAL_ERROR
- "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' "
- "but CMAKE_OSX_SYSROOT:\n \"${_CMAKE_OSX_SYSROOT_ORIG}\"\n"
- "is not set to a MacOSX SDK with a recognized version. "
- "Either set CMAKE_OSX_SYSROOT to a valid SDK or set "
- "CMAKE_OSX_DEPLOYMENT_TARGET to empty.")
- endif()
- if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "${_sdk_ver}")
- message(FATAL_ERROR
- "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) "
- "is greater than CMAKE_OSX_SYSROOT SDK:\n ${_CMAKE_OSX_SYSROOT_ORIG}\n"
- "Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${_sdk_ver} or lower.")
- endif()
-endif()
-
# Enable shared library versioning.
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")