mirror of
https://github.com/openharmony/third_party_cmake.git
synced 2026-07-21 00:05:24 -04:00
Merge branch 'release-3.19' into backport-3.19-rel-file-table
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "3.19.0"
|
||||
$sha256sum = "67BBDA67C98C5F0789199FE1DB650F12274A6AD40FD8CAE88D208029AC618905"
|
||||
$version = "3.19.7"
|
||||
$sha256sum = "E6788D6E23B3026C37FCFA7658075D6B5F9113F26FAE17FE372AD4A7EE62D5FD"
|
||||
$filename = "cmake-$version-win64-x64"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
|
||||
@@ -7,6 +7,7 @@ $tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$release = "wix3112rtm"
|
||||
$sha256sum = "2C1888D5D1DBA377FC7FA14444CF556963747FF9A0A289A3599CF09DA03B9E2E"
|
||||
$filename = "wix311-binaries"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/$release/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\wix\bin")
|
||||
@@ -38,7 +38,7 @@
|
||||
CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
|
||||
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
||||
VCVARSPLATFORM: "x64"
|
||||
VCVARSVERSION: "14.28"
|
||||
VCVARSVERSION: "14.28.29910"
|
||||
|
||||
### External testing
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
CMAKE_CONFIGURATION: windows_vs2019_x64
|
||||
CMAKE_GENERATOR: "Visual Studio 16 2019"
|
||||
CMAKE_GENERATOR_PLATFORM: "x64"
|
||||
CMAKE_GENERATOR_TOOLSET: "v142,version=14.28"
|
||||
CMAKE_GENERATOR_TOOLSET: "v142,version=14.28.29910"
|
||||
|
||||
## Tags
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
- windows
|
||||
- shell
|
||||
- vs2019
|
||||
- msvc-19.28
|
||||
- msvc-19.28-16.9
|
||||
- nonconcurrent
|
||||
|
||||
.windows_builder_ext_tags:
|
||||
@@ -68,15 +68,18 @@
|
||||
- windows
|
||||
- shell
|
||||
- vs2019
|
||||
- msvc-19.28
|
||||
- msvc-19.28-16.9
|
||||
- concurrent
|
||||
|
||||
## Windows-specific scripts
|
||||
|
||||
.before_script_windows: &before_script_windows
|
||||
- Invoke-Expression -Command .gitlab/ci/wix.ps1
|
||||
- Invoke-Expression -Command .gitlab/ci/cmake.ps1
|
||||
- Invoke-Expression -Command .gitlab/ci/ninja.ps1
|
||||
- $pwdpath = $pwd.Path
|
||||
- Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
|
||||
- (& "$env:WIX\bin\light.exe" -help) | Select -First 1
|
||||
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
|
||||
- cmake --version
|
||||
- ninja --version
|
||||
|
||||
@@ -17,7 +17,8 @@ find_file
|
||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
|
||||
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``INCLUDE``
|
||||
and ``PATH``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
|
||||
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
|
||||
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
|
||||
|
||||
@@ -17,7 +17,8 @@ find_library
|
||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH`
|
||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
|
||||
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``LIB``
|
||||
and ``PATH``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
|
||||
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
|
||||
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
|
||||
|
||||
@@ -17,7 +17,8 @@ find_path
|
||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
|
||||
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``INCLUDE``
|
||||
and ``PATH``.
|
||||
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
|
||||
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
|
||||
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
|
||||
|
||||
@@ -5,7 +5,11 @@ GENERATOR_IS_MULTI_CONFIG
|
||||
|
||||
Read-only property that is true on multi-configuration generators.
|
||||
|
||||
True when using a multi-configuration generator
|
||||
(such as :ref:`Visual Studio Generators` or :generator:`Xcode`).
|
||||
True when using a multi-configuration generator such as:
|
||||
|
||||
* :generator:`Ninja Multi-Config`
|
||||
* :ref:`Visual Studio Generators`
|
||||
* :generator:`Xcode`
|
||||
|
||||
Multi-config generators use :variable:`CMAKE_CONFIGURATION_TYPES`
|
||||
as the set of configurations and ignore :variable:`CMAKE_BUILD_TYPE`.
|
||||
|
||||
@@ -400,3 +400,43 @@ Changes made since CMake 3.19.0 include the following.
|
||||
* The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal
|
||||
binary with ``x86_64`` and ``arm64`` architectures. It requires
|
||||
macOS 10.10 or newer.
|
||||
|
||||
3.19.4
|
||||
------
|
||||
|
||||
* The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM`
|
||||
variable introduced in 3.19.0 previously worked only with the
|
||||
:generator:`Visual Studio 14 2015` generator. It has now been fixed to
|
||||
work with :ref:`Visual Studio Generators` for later VS versions too.
|
||||
|
||||
3.19.5
|
||||
------
|
||||
|
||||
* When :prop_tgt:`IOS_INSTALL_COMBINED` is enabled and the :generator:`Xcode`
|
||||
generator is used, it is now possible to initiate an install or package
|
||||
creation by running ``cmake --install`` or ``cpack`` from the command line.
|
||||
When using the Xcode new build system, these are the only supported methods
|
||||
due to a limitation of Xcode. Initiating these operations by building the
|
||||
``install`` or ``package`` targets in Xcode is only supported when using
|
||||
the legacy build system.
|
||||
|
||||
* The framework handling introduced in 3.19.0 as part of supporting Xcode's
|
||||
*Link Binaries With Libraries* build phase broke the ability to switch
|
||||
between device and simulator builds without reconfiguring. That capability
|
||||
has now been restored.
|
||||
|
||||
3.19.6
|
||||
------
|
||||
|
||||
* The :manual:`cmake-presets(7)` feature no longer allows comments in
|
||||
``CMakePresets.json`` or ``CMakeUserPresets.json`` files.
|
||||
This was mistakenly allowed by the implementation in CMake 3.19.0 through
|
||||
CMake 3.19.5, and was not documented.
|
||||
|
||||
3.19.7
|
||||
------
|
||||
|
||||
* With :ref:`Visual Studio Generators` for VS 2017 and higher, the
|
||||
:variable:`CMAKE_GENERATOR_TOOLSET` field ``version=`` now accepts
|
||||
three-component MSVC toolset versions such as ``14.28.29910``.
|
||||
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_VERSION` variable.
|
||||
|
||||
@@ -11,3 +11,23 @@ may be specified by a field in :variable:`CMAKE_GENERATOR_TOOLSET` of
|
||||
the form ``version=14.11``. If none is specified CMake will choose a default
|
||||
toolset. The value may be empty if no minor version was selected and the
|
||||
default is used.
|
||||
|
||||
If the value is not empty, it is the version number that MSBuild uses in
|
||||
its ``Microsoft.VCToolsVersion.*.props`` file names.
|
||||
|
||||
.. versionadded:: 3.19.7
|
||||
|
||||
VS 16.9's toolset may also be specified as ``14.28.16.9`` because
|
||||
VS 16.10 uses the file name ``Microsoft.VCToolsVersion.14.28.16.9.props``.
|
||||
|
||||
Three-Component MSVC Toolset Versions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 3.19.7
|
||||
|
||||
The ``version=`` field may be given a three-component toolset version
|
||||
such as ``14.28.29910``, and CMake will convert it to the name used by
|
||||
MSBuild ``Microsoft.VCToolsVersion.*.props`` files. This is useful
|
||||
to distinguish between VS 16.8's ``14.28.29333`` toolset and VS 16.9's
|
||||
``14.28.29910`` toolset. It also matches ``vcvarsall``'s ``-vcvars_ver=``
|
||||
behavior.
|
||||
|
||||
@@ -3,7 +3,7 @@ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM
|
||||
|
||||
.. versionadded:: 3.19
|
||||
|
||||
Override the :ref:`Windows 10 SDK Maximum Version for VS 2015`.
|
||||
Override the :ref:`Windows 10 SDK Maximum Version for VS 2015` and beyond.
|
||||
|
||||
The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable may
|
||||
be set to a false value (e.g. ``OFF``, ``FALSE``, or ``0``) or the SDK version
|
||||
|
||||
@@ -26,7 +26,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(_CRAYC) || defined(__cray__)
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
@@ -77,7 +77,7 @@ int main(int argc, char* argv[])
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(_CRAYC) || defined(__cray__)
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
|
||||
@@ -20,7 +20,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(_CRAYC) || defined(__cray__)
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(_CRAYC) || defined(__cray__)
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_dialect_default[argc];
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
#else
|
||||
PRINT *, 'INFO:compiler[]'
|
||||
#endif
|
||||
#if defined(_CRAYFTN)
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]'
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0057 NEW) # if IN_LIST
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
# Function to print messages of this module
|
||||
function(_ios_install_combined_message)
|
||||
message("[iOS combined] " ${ARGN})
|
||||
message(STATUS "[iOS combined] " ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# Get build settings for the current target/config/SDK by running
|
||||
@@ -176,29 +177,33 @@ function(_ios_install_combined_keep_archs lib archs)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(_ios_install_combined_detect_sdks this_sdk_var corr_sdk_var)
|
||||
set(this_sdk "$ENV{PLATFORM_NAME}")
|
||||
if("${this_sdk}" STREQUAL "")
|
||||
message(FATAL_ERROR "Environment variable PLATFORM_NAME is empty")
|
||||
function(_ios_install_combined_detect_associated_sdk corr_sdk_var)
|
||||
if("${PLATFORM_NAME}" STREQUAL "")
|
||||
message(FATAL_ERROR "PLATFORM_NAME should not be empty")
|
||||
endif()
|
||||
|
||||
set(all_platforms "$ENV{SUPPORTED_PLATFORMS}")
|
||||
if("${all_platforms}" STREQUAL "")
|
||||
message(FATAL_ERROR "Environment variable SUPPORTED_PLATFORMS is empty")
|
||||
if("${SUPPORTED_PLATFORMS}" STREQUAL "")
|
||||
_ios_install_combined_get_build_setting(
|
||||
${PLATFORM_NAME} SUPPORTED_PLATFORMS all_platforms)
|
||||
if("${all_platforms}" STREQUAL "")
|
||||
message(FATAL_ERROR
|
||||
"SUPPORTED_PLATFORMS not set as an environment variable nor "
|
||||
"able to be determined from project")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
separate_arguments(all_platforms)
|
||||
if(NOT this_sdk IN_LIST all_platforms)
|
||||
message(FATAL_ERROR "`${this_sdk}` not found in `${all_platforms}`")
|
||||
if(NOT PLATFORM_NAME IN_LIST all_platforms)
|
||||
message(FATAL_ERROR "`${PLATFORM_NAME}` not found in `${all_platforms}`")
|
||||
endif()
|
||||
|
||||
list(REMOVE_ITEM all_platforms "" "${this_sdk}")
|
||||
list(REMOVE_ITEM all_platforms "" "${PLATFORM_NAME}")
|
||||
list(LENGTH all_platforms all_platforms_length)
|
||||
if(NOT all_platforms_length EQUAL 1)
|
||||
message(FATAL_ERROR "Expected one element: ${all_platforms}")
|
||||
endif()
|
||||
|
||||
set(${this_sdk_var} "${this_sdk}" PARENT_SCOPE)
|
||||
set(${corr_sdk_var} "${all_platforms}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -274,10 +279,10 @@ function(ios_install_combined target destination)
|
||||
_ios_install_combined_message("Destination: ${destination}")
|
||||
|
||||
# Get SDKs
|
||||
_ios_install_combined_detect_sdks(this_sdk corr_sdk)
|
||||
_ios_install_combined_detect_associated_sdk(corr_sdk)
|
||||
|
||||
# Get architectures of the target
|
||||
_ios_install_combined_get_valid_archs("${this_sdk}" this_valid_archs)
|
||||
_ios_install_combined_get_valid_archs("${PLATFORM_NAME}" this_valid_archs)
|
||||
_ios_install_combined_get_valid_archs("${corr_sdk}" corr_valid_archs)
|
||||
_ios_install_combined_prune_common_archs("${corr_sdk}" corr_valid_archs this_valid_archs)
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
|
||||
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
|
||||
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
macro(__compiler_clang lang)
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc ")
|
||||
endmacro()
|
||||
else()
|
||||
include(Compiler/GNU)
|
||||
|
||||
@@ -13,7 +13,15 @@ set(CMAKE_Fortran_COMPILE_WITH_DEFINES 1)
|
||||
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
|
||||
|
||||
set(CMAKE_Fortran_PREPROCESS_SOURCE
|
||||
"<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
|
||||
if(CMAKE_HOST_WIN32)
|
||||
# MSVC-like
|
||||
set(CMAKE_Fortran_PREPROCESS_SOURCE
|
||||
"<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -Fi<PREPROCESSED_SOURCE>")
|
||||
else()
|
||||
# GNU-like
|
||||
set(CMAKE_Fortran_PREPROCESS_SOURCE
|
||||
"<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -P <SOURCE> -o <PREPROCESSED_SOURCE>")
|
||||
endif()
|
||||
|
||||
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")
|
||||
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp")
|
||||
|
||||
+18
-3
@@ -1186,7 +1186,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
else()
|
||||
elseif(Boost_VERSION_STRING VERSION_LESS 1.75.0)
|
||||
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||
set(_Boost_FIBER_DEPENDENCIES context)
|
||||
@@ -1200,7 +1200,22 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.75.0)
|
||||
else()
|
||||
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
|
||||
set(_Boost_COROUTINE_DEPENDENCIES context)
|
||||
set(_Boost_FIBER_DEPENDENCIES context)
|
||||
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
|
||||
set(_Boost_JSON_DEPENDENCIES container)
|
||||
set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
|
||||
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
|
||||
set(_Boost_MPI_DEPENDENCIES serialization)
|
||||
set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
|
||||
set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
|
||||
set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
|
||||
set(_Boost_TIMER_DEPENDENCIES chrono)
|
||||
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
|
||||
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
|
||||
if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.76.0)
|
||||
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1472,7 +1487,7 @@ else()
|
||||
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
|
||||
# _Boost_COMPONENT_DEPENDENCIES.
|
||||
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
|
||||
"1.74.0" "1.74"
|
||||
"1.75.0" "1.75" "1.74.0" "1.74"
|
||||
"1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
|
||||
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
|
||||
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
|
||||
|
||||
@@ -561,7 +561,7 @@ else()
|
||||
_CUDAToolkit_find_root_dir(SEARCH_PATHS "${CUDAToolkit_ROOT}" FIND_FLAGS PATH_SUFFIXES bin NO_DEFAULT_PATH)
|
||||
endif()
|
||||
if(NOT CUDAToolkit_ROOT_DIR)
|
||||
_CUDAToolkit_find_root_dir(FIND_FLAGS PATHS "ENV CUDA_PATH" PATH_SUFFIXES bin)
|
||||
_CUDAToolkit_find_root_dir(FIND_FLAGS PATHS ENV CUDA_PATH PATH_SUFFIXES bin)
|
||||
endif()
|
||||
|
||||
# If the user specified CUDAToolkit_ROOT but the toolkit could not be found, this is an error.
|
||||
|
||||
@@ -360,9 +360,11 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
||||
execute_process(
|
||||
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file}
|
||||
WORKING_DIRECTORY ${scratch_dir}
|
||||
OUTPUT_VARIABLE output
|
||||
ERROR_VARIABLE output
|
||||
RESULT_VARIABLE return_value
|
||||
)
|
||||
if(return_value)
|
||||
if(return_value AND NOT HDF5_FIND_QUIETLY)
|
||||
message(STATUS
|
||||
"HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.")
|
||||
else()
|
||||
@@ -374,7 +376,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
||||
RESULT_VARIABLE return_value
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(return_value)
|
||||
if(return_value AND NOT HDF5_FIND_QUIETLY)
|
||||
message(STATUS
|
||||
"Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
|
||||
endif()
|
||||
@@ -385,7 +387,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
||||
RESULT_VARIABLE return_value
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(return_value)
|
||||
if(return_value AND NOT HDF5_FIND_QUIETLY)
|
||||
message(STATUS
|
||||
"Unable to determine HDF5 ${language} version_var from HDF5 wrapper.")
|
||||
endif()
|
||||
|
||||
@@ -37,7 +37,10 @@ if(CMAKE_HOST_WIN32)
|
||||
list(PREPEND PKG_CONFIG_NAMES "pkg-config.bat")
|
||||
endif()
|
||||
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES ${PKG_CONFIG_NAMES} DOC "pkg-config executable")
|
||||
find_program(PKG_CONFIG_EXECUTABLE
|
||||
NAMES ${PKG_CONFIG_NAMES}
|
||||
NAMES_PER_DIR
|
||||
DOC "pkg-config executable")
|
||||
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
set(_PKG_CONFIG_FAILURE_MESSAGE "")
|
||||
|
||||
@@ -1528,7 +1528,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
|
||||
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
|
||||
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
|
||||
elseif (DEFINED ${_PYTHON_PREFIX}_FIND_VERSION)
|
||||
list (APPEND VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
|
||||
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
|
||||
endif()
|
||||
|
||||
while (TRUE)
|
||||
@@ -1996,7 +1996,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
|
||||
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
|
||||
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
|
||||
elseif (DEFINED ${_PYTHON_PREFIX}_FIND_VERSION)
|
||||
list (APPEND VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
|
||||
list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${${_PYTHON_PREFIX}_FIND_VERSION})
|
||||
endif()
|
||||
|
||||
while (TRUE)
|
||||
|
||||
@@ -155,9 +155,16 @@ function(xctest_add_bundle target testee)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
XCODE_ATTRIBUTE_BUNDLE_LOADER "$(TEST_HOST)"
|
||||
XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:${testee}>")
|
||||
if(NOT XCODE_VERSION VERSION_LESS 7.3)
|
||||
if(XCODE_VERSION VERSION_GREATER_EQUAL 7.3)
|
||||
# CMAKE_XCODE_BUILD_SYSTEM equals 12 means that at least Xcode 11.x is used.
|
||||
if(CMAKE_XCODE_BUILD_SYSTEM EQUAL 12 AND
|
||||
NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(_output_directory "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>")
|
||||
else()
|
||||
set(_output_directory "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>/PlugIns")
|
||||
endif()
|
||||
set_target_properties(${target} PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:${testee}>/PlugIns")
|
||||
LIBRARY_OUTPUT_DIRECTORY "${_output_directory}")
|
||||
endif()
|
||||
else(XCODE)
|
||||
target_link_libraries(${target}
|
||||
|
||||
@@ -735,7 +735,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
|
||||
set(gp_regex_cmp_count 1)
|
||||
elseif(gp_tool MATCHES "otool$")
|
||||
set(gp_cmd_args "-L")
|
||||
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$")
|
||||
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)(, weak)?\\)${eol_char}$")
|
||||
set(gp_regex_error "")
|
||||
set(gp_regex_fallback "")
|
||||
set(gp_regex_cmp_count 3)
|
||||
|
||||
@@ -291,6 +291,7 @@ if(MSVC)
|
||||
foreach(crt
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_1.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_2.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_atomic_wait.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll"
|
||||
"${MSVC_CRT_DIR}/vcruntime${v}_1.dll"
|
||||
)
|
||||
@@ -319,6 +320,7 @@ if(MSVC)
|
||||
foreach(crt
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_1d.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}_2d.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}d_atomic_wait.dll"
|
||||
"${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll"
|
||||
"${MSVC_CRT_DIR}/vcruntime${v}_1d.dll"
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include(Platform/Linux-Intel)
|
||||
__linux_compiler_intel(Fortran)
|
||||
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS " -nofor_main")
|
||||
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS " -nofor-main")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "")
|
||||
|
||||
@@ -169,6 +169,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
|
||||
macro(__windows_compiler_clang_base lang)
|
||||
set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
|
||||
__windows_compiler_msvc(${lang})
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc ")
|
||||
endmacro()
|
||||
else()
|
||||
cmake_policy(GET CMP0091 __WINDOWS_CLANG_CMP0091)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# CMake version number components.
|
||||
set(CMake_VERSION_MAJOR 3)
|
||||
set(CMake_VERSION_MINOR 19)
|
||||
set(CMake_VERSION_PATCH 3)
|
||||
set(CMake_VERSION_PATCH 7)
|
||||
#set(CMake_VERSION_RC 0)
|
||||
set(CMake_VERSION_IS_DIRTY 0)
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ int cmCTestUpdateHandler::ProcessHandler()
|
||||
if (localModifications) {
|
||||
xml.Content("Update error: "
|
||||
"There are modified or conflicting files in the repository");
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
cmCTestLog(this->CTest, WARNING,
|
||||
" There are modified or conflicting files in the repository"
|
||||
<< std::endl);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,13 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
|
||||
endif()
|
||||
cm_check_cxx_feature(unique_ptr)
|
||||
if (NOT CMAKE_CXX_STANDARD LESS "17")
|
||||
cm_check_cxx_feature(filesystem TRY_RUN)
|
||||
if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
|
||||
cm_check_cxx_feature(filesystem TRY_RUN)
|
||||
else()
|
||||
# In cross-compiling mode, it is not possible to check implementation bugs
|
||||
# so rely only on conformance done by compilation
|
||||
cm_check_cxx_feature(filesystem)
|
||||
endif()
|
||||
else()
|
||||
set(CMake_HAVE_CXX_FILESYSTEM FALSE)
|
||||
endif()
|
||||
|
||||
@@ -44,7 +44,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo(
|
||||
std::string line;
|
||||
static const cmsys::RegularExpression rpathRegex("^ *cmd LC_RPATH$");
|
||||
static const cmsys::RegularExpression loadDylibRegex(
|
||||
"^ *cmd LC_LOAD_DYLIB$");
|
||||
"^ *cmd LC_LOAD(_WEAK)?_DYLIB$");
|
||||
static const cmsys::RegularExpression pathRegex(
|
||||
"^ *path (.*) \\(offset [0-9]+\\)$");
|
||||
static const cmsys::RegularExpression nameRegex(
|
||||
|
||||
@@ -839,6 +839,7 @@ cmCMakePresetsFile::ReadFileResult cmCMakePresetsFile::ReadJSONFile(
|
||||
|
||||
Json::Value root;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReaderBuilder::strictMode(&builder.settings_);
|
||||
if (!Json::parseFromStream(builder, fin, &root, nullptr)) {
|
||||
return ReadFileResult::JSON_PARSE_ERROR;
|
||||
}
|
||||
|
||||
@@ -474,6 +474,12 @@ std::vector<std::string> const& cmComputeLinkInformation::GetFrameworkPaths()
|
||||
return this->FrameworkPaths;
|
||||
}
|
||||
|
||||
std::set<std::string> const&
|
||||
cmComputeLinkInformation::GetFrameworkPathsEmitted() const
|
||||
{
|
||||
return this->FrameworkPathsEmitted;
|
||||
}
|
||||
|
||||
const std::set<const cmGeneratorTarget*>&
|
||||
cmComputeLinkInformation::GetSharedLibrariesLinked() const
|
||||
{
|
||||
@@ -699,9 +705,13 @@ void cmComputeLinkInformation::AddItem(BT<std::string> const& item,
|
||||
} else {
|
||||
// This is not a CMake target. Use the name given.
|
||||
if (cmSystemTools::FileIsFullPath(item.Value)) {
|
||||
if (cmSystemTools::FileIsDirectory(item.Value)) {
|
||||
if (cmSystemTools::IsPathToFramework(item.Value) &&
|
||||
this->Makefile->IsOn("APPLE")) {
|
||||
// This is a framework.
|
||||
this->AddFrameworkItem(item.Value);
|
||||
} else if (cmSystemTools::FileIsDirectory(item.Value)) {
|
||||
// This is a directory.
|
||||
this->AddDirectoryItem(item.Value);
|
||||
this->DropDirectoryItem(item.Value);
|
||||
} else {
|
||||
// Use the full path given to the library file.
|
||||
this->Depends.push_back(item.Value);
|
||||
@@ -1306,16 +1316,6 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
|
||||
}
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::AddDirectoryItem(std::string const& item)
|
||||
{
|
||||
if (this->Makefile->IsOn("APPLE") &&
|
||||
cmSystemTools::IsPathToFramework(item)) {
|
||||
this->AddFrameworkItem(item);
|
||||
} else {
|
||||
this->DropDirectoryItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
|
||||
{
|
||||
// A full path to a directory was found as a link item. Warn the
|
||||
@@ -1342,8 +1342,8 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
|
||||
"CMAKE_", this->LinkLanguage, "_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES");
|
||||
this->Makefile->GetDefExpandList(implicitDirVar, implicitDirVec);
|
||||
|
||||
this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(),
|
||||
implicitDirVec.end());
|
||||
this->FrameworkPathsEmitted.insert(implicitDirVec.begin(),
|
||||
implicitDirVec.end());
|
||||
|
||||
// Regular expression to extract a framework path and name.
|
||||
this->SplitFramework.compile("(.*)/(.*)\\.framework$");
|
||||
@@ -1351,7 +1351,7 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
|
||||
|
||||
void cmComputeLinkInformation::AddFrameworkPath(std::string const& p)
|
||||
{
|
||||
if (this->FrameworkPathsEmmitted.insert(p).second) {
|
||||
if (this->FrameworkPathsEmitted.insert(p).second) {
|
||||
this->FrameworkPaths.push_back(p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
std::vector<BT<std::string>> GetDirectoriesWithBacktraces();
|
||||
std::vector<std::string> const& GetDepends() const;
|
||||
std::vector<std::string> const& GetFrameworkPaths() const;
|
||||
std::set<std::string> const& GetFrameworkPathsEmitted() const;
|
||||
std::string GetLinkLanguage() const { return this->LinkLanguage; }
|
||||
std::vector<std::string> const& GetRuntimeSearchPath() const;
|
||||
std::string const& GetRuntimeFlag() const { return this->RuntimeFlag; }
|
||||
@@ -155,7 +156,6 @@ private:
|
||||
void AddFullItem(BT<std::string> const& item);
|
||||
bool CheckImplicitDirItem(std::string const& item);
|
||||
void AddUserItem(BT<std::string> const& item, bool pathNotKnown);
|
||||
void AddDirectoryItem(std::string const& item);
|
||||
void AddFrameworkItem(std::string const& item);
|
||||
void DropDirectoryItem(std::string const& item);
|
||||
bool CheckSharedLibNoSOName(std::string const& item);
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
// Framework info.
|
||||
void ComputeFrameworkInfo();
|
||||
void AddFrameworkPath(std::string const& p);
|
||||
std::set<std::string> FrameworkPathsEmmitted;
|
||||
std::set<std::string> FrameworkPathsEmitted;
|
||||
cmsys::RegularExpression SplitFramework;
|
||||
|
||||
// Linker search path computation.
|
||||
|
||||
@@ -588,8 +588,9 @@ void cmGlobalNinjaGenerator::CleanMetaData()
|
||||
// `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the
|
||||
// future pending further investigation into how Ninja works upstream
|
||||
// (ninja#1721).
|
||||
if (this->NinjaSupportsUnconditionalRecompactTool && expectBuildManifest &&
|
||||
!missingBuildManifest) {
|
||||
if (this->NinjaSupportsUnconditionalRecompactTool &&
|
||||
!this->GetCMakeInstance()->GetRegenerateDuringBuild() &&
|
||||
expectBuildManifest && !missingBuildManifest) {
|
||||
run_ninja_tool({ "recompact" });
|
||||
}
|
||||
if (this->NinjaSupportsRestatTool && this->OutputPathPrefix.empty()) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "cmGlobalVisualStudio10Generator.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <cm/memory>
|
||||
|
||||
@@ -302,16 +303,16 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
|
||||
// If a specific minor version of the toolset was requested, verify that it
|
||||
// is compatible to the major version and that is exists on disk.
|
||||
// If not clear the value.
|
||||
std::string version = this->GeneratorToolsetVersion;
|
||||
std::string versionToolset = this->GeneratorToolsetVersion;
|
||||
cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9][0-9]");
|
||||
if (regex.find(version)) {
|
||||
version = "v" + version.erase(2, 1);
|
||||
if (regex.find(versionToolset)) {
|
||||
versionToolset = "v" + versionToolset.erase(2, 1);
|
||||
} else {
|
||||
// Version not recognized. Clear it.
|
||||
version.clear();
|
||||
versionToolset.clear();
|
||||
}
|
||||
|
||||
if (!cmHasPrefix(version, this->GetPlatformToolsetString())) {
|
||||
if (!cmHasPrefix(versionToolset, this->GetPlatformToolsetString())) {
|
||||
std::ostringstream e;
|
||||
/* clang-format off */
|
||||
e <<
|
||||
@@ -329,15 +330,20 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
|
||||
this->GeneratorToolsetVersion.clear();
|
||||
}
|
||||
|
||||
bool const isDefaultToolset =
|
||||
this->IsDefaultToolset(this->GeneratorToolsetVersion);
|
||||
if (isDefaultToolset) {
|
||||
// If the given version is the default toolset, remove the setting
|
||||
this->GeneratorToolsetVersion.clear();
|
||||
} else {
|
||||
std::string const toolsetPath = this->GetAuxiliaryToolset();
|
||||
if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) {
|
||||
|
||||
std::string auxProps;
|
||||
switch (this->FindAuxToolset(this->GeneratorToolsetVersion, auxProps)) {
|
||||
case AuxToolset::None:
|
||||
this->GeneratorToolsetVersionProps = {};
|
||||
break;
|
||||
case AuxToolset::Default:
|
||||
// The given version is the default toolset. Remove the setting.
|
||||
this->GeneratorToolsetVersion.clear();
|
||||
this->GeneratorToolsetVersionProps = {};
|
||||
break;
|
||||
case AuxToolset::PropsExist:
|
||||
this->GeneratorToolsetVersionProps = std::move(auxProps);
|
||||
break;
|
||||
case AuxToolset::PropsMissing: {
|
||||
std::ostringstream e;
|
||||
/* clang-format off */
|
||||
e <<
|
||||
@@ -347,22 +353,24 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
|
||||
" " << this->GetPlatformToolsetString() << ",version=" <<
|
||||
this->GeneratorToolsetVersion << "\n"
|
||||
"does not seem to be installed at\n" <<
|
||||
" " << toolsetPath;
|
||||
" " << auxProps;
|
||||
;
|
||||
/* clang-format on */
|
||||
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
|
||||
|
||||
// Clear the configured tool-set
|
||||
this->GeneratorToolsetVersion.clear();
|
||||
}
|
||||
this->GeneratorToolsetVersionProps = {};
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
if (const char* toolset = this->GetPlatformToolset()) {
|
||||
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
|
||||
}
|
||||
if (const char* version = this->GetPlatformToolsetVersion()) {
|
||||
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VERSION", version);
|
||||
if (!this->GeneratorToolsetVersion.empty()) {
|
||||
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VERSION",
|
||||
this->GeneratorToolsetVersion);
|
||||
}
|
||||
if (const char* hostArch = this->GetPlatformToolsetHostArchitecture()) {
|
||||
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE", hostArch);
|
||||
@@ -719,23 +727,10 @@ std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString()
|
||||
return empty;
|
||||
}
|
||||
|
||||
const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetVersion() const
|
||||
{
|
||||
std::string const& version = this->GetPlatformToolsetVersionString();
|
||||
if (version.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return version.c_str();
|
||||
}
|
||||
|
||||
std::string const&
|
||||
cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionString() const
|
||||
cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionProps() const
|
||||
{
|
||||
if (!this->GeneratorToolsetVersion.empty()) {
|
||||
return this->GeneratorToolsetVersion;
|
||||
}
|
||||
static std::string const empty;
|
||||
return empty;
|
||||
return this->GeneratorToolsetVersionProps;
|
||||
}
|
||||
|
||||
const char*
|
||||
@@ -792,15 +787,11 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetCudaCustomDirString() const
|
||||
return this->GeneratorToolsetCudaCustomDir;
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudio10Generator::IsDefaultToolset(
|
||||
const std::string&) const
|
||||
cmGlobalVisualStudio10Generator::AuxToolset
|
||||
cmGlobalVisualStudio10Generator::FindAuxToolset(std::string&,
|
||||
std::string&) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudio10Generator::GetAuxiliaryToolset() const
|
||||
{
|
||||
return {};
|
||||
return AuxToolset::None;
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudio10Generator::FindMakeProgram(cmMakefile* mf)
|
||||
|
||||
@@ -61,9 +61,8 @@ public:
|
||||
const char* GetPlatformToolset() const;
|
||||
std::string const& GetPlatformToolsetString() const;
|
||||
|
||||
/** The toolset version. */
|
||||
const char* GetPlatformToolsetVersion() const;
|
||||
std::string const& GetPlatformToolsetVersionString() const;
|
||||
/** The toolset version props file, if any. */
|
||||
std::string const& GetPlatformToolsetVersionProps() const;
|
||||
|
||||
/** The toolset host architecture name (e.g. x64 for 64-bit host tools). */
|
||||
const char* GetPlatformToolsetHostArchitecture() const;
|
||||
@@ -120,9 +119,6 @@ public:
|
||||
std::string Encoding() override;
|
||||
const char* GetToolsVersion() const;
|
||||
|
||||
virtual bool IsDefaultToolset(const std::string& version) const;
|
||||
virtual std::string GetAuxiliaryToolset() const;
|
||||
|
||||
bool GetSupportsUnityBuilds() const { return this->SupportsUnityBuilds; }
|
||||
|
||||
bool FindMakeProgram(cmMakefile* mf) override;
|
||||
@@ -168,6 +164,16 @@ protected:
|
||||
virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
|
||||
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
|
||||
|
||||
enum class AuxToolset
|
||||
{
|
||||
None,
|
||||
Default,
|
||||
PropsExist,
|
||||
PropsMissing
|
||||
};
|
||||
virtual AuxToolset FindAuxToolset(std::string& version,
|
||||
std::string& props) const;
|
||||
|
||||
std::string const& GetMSBuildCommand();
|
||||
|
||||
cmIDEFlagTable const* LoadFlagTable(std::string const& optionsName,
|
||||
@@ -176,7 +182,7 @@ protected:
|
||||
std::string const& table) const;
|
||||
|
||||
std::string GeneratorToolset;
|
||||
std::string GeneratorToolsetVersion;
|
||||
std::string GeneratorToolsetVersionProps;
|
||||
std::string GeneratorToolsetHostArchitecture;
|
||||
std::string GeneratorToolsetCustomVCTargetsDir;
|
||||
std::string GeneratorToolsetCuda;
|
||||
@@ -230,6 +236,8 @@ private:
|
||||
std::string FindDevEnvCommand() override;
|
||||
std::string GetVSMakeProgram() override { return this->GetMSBuildCommand(); }
|
||||
|
||||
std::string GeneratorToolsetVersion;
|
||||
|
||||
bool PlatformToolsetNeedsDebugEnum;
|
||||
|
||||
bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf);
|
||||
|
||||
@@ -253,6 +253,12 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion(
|
||||
// If value is an invalid pointer, leave result unchanged.
|
||||
}
|
||||
|
||||
return this->GetWindows10SDKMaxVersionDefault(mf);
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersionDefault(
|
||||
cmMakefile*) const
|
||||
{
|
||||
// The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0.
|
||||
//
|
||||
// "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is
|
||||
|
||||
@@ -40,9 +40,13 @@ protected:
|
||||
// of the toolset is installed
|
||||
bool IsWindowsStoreToolsetInstalled() const;
|
||||
|
||||
// Used to adjust the max-SDK-version calculation to accommodate user
|
||||
// configuration.
|
||||
std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const;
|
||||
|
||||
// Used to make sure that the Windows 10 SDK selected can work with the
|
||||
// version of the toolset.
|
||||
virtual std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const;
|
||||
virtual std::string GetWindows10SDKMaxVersionDefault(cmMakefile* mf) const;
|
||||
|
||||
virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmGlobalVisualStudioVersionedGenerator.h"
|
||||
|
||||
#include <cmext/string_view>
|
||||
|
||||
#include "cmsys/FStream.hxx"
|
||||
#include "cmsys/Glob.hxx"
|
||||
|
||||
#include "cmAlgorithms.h"
|
||||
#include "cmDocumentationEntry.h"
|
||||
#include "cmLocalVisualStudio10Generator.h"
|
||||
@@ -391,27 +396,6 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion(
|
||||
return vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion);
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
|
||||
const std::string& version) const
|
||||
{
|
||||
if (version.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string vcToolsetVersion;
|
||||
if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) {
|
||||
|
||||
cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9]+");
|
||||
if (regex.find(version) && regex.find(vcToolsetVersion)) {
|
||||
const auto majorMinorEnd = vcToolsetVersion.find('.', 3);
|
||||
const auto majorMinor = vcToolsetVersion.substr(0, majorMinorEnd);
|
||||
return version == majorMinor;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
|
||||
{
|
||||
// Supported from Visual Studio 16.7 Preview 3.
|
||||
@@ -446,29 +430,92 @@ cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision()
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
|
||||
cmGlobalVisualStudioVersionedGenerator::AuxToolset
|
||||
cmGlobalVisualStudioVersionedGenerator::FindAuxToolset(
|
||||
std::string& version, std::string& props) const
|
||||
{
|
||||
const char* version = this->GetPlatformToolsetVersion();
|
||||
if (version) {
|
||||
std::string instancePath;
|
||||
GetVSInstance(instancePath);
|
||||
std::string toolsetDir = instancePath + "/VC/Auxiliary/Build";
|
||||
char sep = '/';
|
||||
if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) {
|
||||
std::string toolsetDot =
|
||||
cmStrCat(toolsetDir, '.', version, "/Microsoft.VCToolsVersion.",
|
||||
version, ".props");
|
||||
if (cmSystemTools::PathExists(toolsetDot)) {
|
||||
sep = '.';
|
||||
if (version.empty()) {
|
||||
return AuxToolset::None;
|
||||
}
|
||||
|
||||
std::string instancePath;
|
||||
this->GetVSInstance(instancePath);
|
||||
cmSystemTools::ConvertToUnixSlashes(instancePath);
|
||||
|
||||
// Translate three-component format accepted by "vcvarsall -vcvars_ver=".
|
||||
cmsys::RegularExpression threeComponent(
|
||||
"^([0-9]+\\.[0-9]+)\\.[0-9][0-9][0-9][0-9][0-9]$");
|
||||
if (threeComponent.find(version)) {
|
||||
// Load "VC/Auxiliary/Build/*/Microsoft.VCToolsVersion.*.txt" files
|
||||
// with two matching components to check their three-component version.
|
||||
std::string const& twoComponent = threeComponent.match(1);
|
||||
std::string pattern =
|
||||
cmStrCat(instancePath, "/VC/Auxiliary/Build/"_s, twoComponent,
|
||||
"*/Microsoft.VCToolsVersion."_s, twoComponent, "*.txt"_s);
|
||||
cmsys::Glob glob;
|
||||
glob.SetRecurseThroughSymlinks(false);
|
||||
if (glob.FindFiles(pattern)) {
|
||||
for (std::string const& txt : glob.GetFiles()) {
|
||||
std::string ver;
|
||||
cmsys::ifstream fin(txt.c_str());
|
||||
if (fin && std::getline(fin, ver)) {
|
||||
// Strip trailing whitespace.
|
||||
ver = ver.substr(0, ver.find_first_not_of("0123456789."));
|
||||
// If the three-component version matches, translate it to
|
||||
// that used by the "Microsoft.VCToolsVersion.*.txt" file name.
|
||||
if (ver == version) {
|
||||
cmsys::RegularExpression extractVersion(
|
||||
"VCToolsVersion\\.([0-9.]+)\\.txt$");
|
||||
if (extractVersion.find(txt)) {
|
||||
version = extractVersion.match(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
std::string toolsetPath =
|
||||
cmStrCat(toolsetDir, sep, version, "/Microsoft.VCToolsVersion.", version,
|
||||
".props");
|
||||
cmSystemTools::ConvertToUnixSlashes(toolsetPath);
|
||||
return toolsetPath;
|
||||
}
|
||||
return {};
|
||||
|
||||
if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) {
|
||||
props = cmStrCat(instancePath, "/VC/Auxiliary/Build."_s, version,
|
||||
"/Microsoft.VCToolsVersion."_s, version, ".props"_s);
|
||||
if (cmSystemTools::PathExists(props)) {
|
||||
return AuxToolset::PropsExist;
|
||||
}
|
||||
}
|
||||
props = cmStrCat(instancePath, "/VC/Auxiliary/Build/"_s, version,
|
||||
"/Microsoft.VCToolsVersion."_s, version, ".props"_s);
|
||||
if (cmSystemTools::PathExists(props)) {
|
||||
return AuxToolset::PropsExist;
|
||||
}
|
||||
|
||||
// Accept the toolset version that is default in the current VS version
|
||||
// by matching the name later VS versions will use for the SxS props files.
|
||||
std::string vcToolsetVersion;
|
||||
if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) {
|
||||
// Accept an exact-match (three-component version).
|
||||
if (version == vcToolsetVersion) {
|
||||
return AuxToolset::Default;
|
||||
}
|
||||
|
||||
// Accept known SxS props file names using four version components
|
||||
// in VS versions later than the current.
|
||||
if (version == "14.28.16.9" && vcToolsetVersion == "14.28.29910") {
|
||||
return AuxToolset::Default;
|
||||
}
|
||||
|
||||
// The first two components of the default toolset version typically
|
||||
// match the name used by later VS versions for the SxS props files.
|
||||
cmsys::RegularExpression twoComponent("^([0-9]+\\.[0-9]+)");
|
||||
if (twoComponent.find(version)) {
|
||||
std::string const versionPrefix = cmStrCat(twoComponent.match(1), '.');
|
||||
if (cmHasPrefix(vcToolsetVersion, versionPrefix)) {
|
||||
return AuxToolset::Default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return AuxToolset::PropsMissing;
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudioVersionedGenerator::InitializeWindows(cmMakefile* mf)
|
||||
@@ -540,7 +587,8 @@ bool cmGlobalVisualStudioVersionedGenerator::IsWin81SDKInstalled() const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersion(
|
||||
std::string
|
||||
cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersionDefault(
|
||||
cmMakefile*) const
|
||||
{
|
||||
return std::string();
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
|
||||
bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
|
||||
|
||||
bool IsDefaultToolset(const std::string& version) const override;
|
||||
std::string GetAuxiliaryToolset() const override;
|
||||
AuxToolset FindAuxToolset(std::string& version,
|
||||
std::string& props) const override;
|
||||
|
||||
bool IsStdOutEncodingSupported() const override;
|
||||
|
||||
@@ -56,7 +56,7 @@ protected:
|
||||
// Check for a Win 8 SDK known to the registry or VS installer tool.
|
||||
bool IsWin81SDKInstalled() const;
|
||||
|
||||
std::string GetWindows10SDKMaxVersion(cmMakefile*) const override;
|
||||
std::string GetWindows10SDKMaxVersionDefault(cmMakefile*) const override;
|
||||
|
||||
std::string FindMSBuildCommand() override;
|
||||
std::string FindDevEnvCommand() override;
|
||||
|
||||
@@ -3620,6 +3620,15 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
||||
|
||||
// now add the left-over link libraries
|
||||
{
|
||||
// Keep track of framework search paths we've already added or that are
|
||||
// part of the set of implicit search paths. We don't want to repeat
|
||||
// them and we also need to avoid hard-coding any SDK-specific paths.
|
||||
// This is essential for getting device-and-simulator builds to work,
|
||||
// otherwise we end up hard-coding a path to the wrong SDK for
|
||||
// SDK-provided frameworks that are added by their full path.
|
||||
std::set<std::string> emitted(cli->GetFrameworkPathsEmitted());
|
||||
const auto& fwPaths = cli->GetFrameworkPaths();
|
||||
emitted.insert(fwPaths.begin(), fwPaths.end());
|
||||
BuildObjectListOrString libPaths(this, true);
|
||||
for (auto const& libItem : configItemMap[configName]) {
|
||||
auto const& libName = *libItem;
|
||||
@@ -3633,8 +3642,12 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
|
||||
const auto fwName =
|
||||
cmSystemTools::GetFilenameWithoutExtension(libPath);
|
||||
const auto fwDir = cmSystemTools::GetParentDirectory(libPath);
|
||||
libPaths.Add("-F " + this->XCodeEscapePath(fwDir));
|
||||
libPaths.Add("-framework " + fwName);
|
||||
if (emitted.insert(fwDir).second) {
|
||||
// This is a search path we had not added before and it isn't an
|
||||
// implicit search path, so we need it
|
||||
libPaths.Add("-F " + this->XCodeEscapePath(fwDir));
|
||||
}
|
||||
libPaths.Add("-framework " + this->XCodeEscapePath(fwName));
|
||||
} else {
|
||||
libPaths.Add(this->XCodeEscapePath(cleanPath));
|
||||
}
|
||||
|
||||
@@ -644,6 +644,8 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||
/* clang-format on */
|
||||
}
|
||||
|
||||
this->AddGeneratorSpecificInstallSetup(fout);
|
||||
|
||||
// Ask each install generator to write its code.
|
||||
cmPolicies::PolicyStatus status = this->GetPolicyStatus(cmPolicies::CMP0082);
|
||||
auto const& installers = this->Makefile->GetInstallGenerators();
|
||||
|
||||
@@ -493,6 +493,8 @@ protected:
|
||||
std::ostream& os, const std::string& config,
|
||||
std::vector<std::string> const& configurationTypes);
|
||||
|
||||
virtual void AddGeneratorSpecificInstallSetup(std::ostream&) {}
|
||||
|
||||
std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
|
||||
std::string const& dir_max);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "cmGeneratorTarget.h"
|
||||
#include "cmGlobalXCodeGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmSourceFile.h"
|
||||
|
||||
class cmGeneratorTarget;
|
||||
@@ -45,13 +46,66 @@ void cmLocalXCodeGenerator::Generate()
|
||||
}
|
||||
}
|
||||
|
||||
void cmLocalXCodeGenerator::GenerateInstallRules()
|
||||
void cmLocalXCodeGenerator::AddGeneratorSpecificInstallSetup(std::ostream& os)
|
||||
{
|
||||
cmLocalGenerator::GenerateInstallRules();
|
||||
|
||||
// First check if we need to warn about incompatible settings
|
||||
for (const auto& target : this->GetGeneratorTargets()) {
|
||||
target->HasMacOSXRpathInstallNameDir("");
|
||||
}
|
||||
|
||||
// CMakeIOSInstallCombined.cmake needs to know the location of the top of
|
||||
// the build directory
|
||||
os << "set(CMAKE_BINARY_DIR \"" << this->GetBinaryDirectory() << "\")\n\n";
|
||||
|
||||
if (this->Makefile->PlatformIsAppleEmbedded()) {
|
||||
std::string platformName;
|
||||
switch (this->Makefile->GetAppleSDKType()) {
|
||||
case cmMakefile::AppleSDK::IPhoneOS:
|
||||
platformName = "iphoneos";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::IPhoneSimulator:
|
||||
platformName = "iphonesimulator";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::AppleTVOS:
|
||||
platformName = "appletvos";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::AppleTVSimulator:
|
||||
platformName = "appletvsimulator";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::WatchOS:
|
||||
platformName = "watchos";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::WatchSimulator:
|
||||
platformName = "watchsimulator";
|
||||
break;
|
||||
case cmMakefile::AppleSDK::MacOS:
|
||||
break;
|
||||
}
|
||||
if (!platformName.empty()) {
|
||||
// The effective platform name is just the platform name with a hyphen
|
||||
// prepended. We can get the SUPPORTED_PLATFORMS from the project file
|
||||
// at runtime, so we don't need to compute that here.
|
||||
/* clang-format off */
|
||||
os <<
|
||||
"if(NOT PLATFORM_NAME)\n"
|
||||
" if(NOT \"$ENV{PLATFORM_NAME}\" STREQUAL \"\")\n"
|
||||
" set(PLATFORM_NAME \"$ENV{PLATFORM_NAME}\")\n"
|
||||
" endif()\n"
|
||||
" if(NOT PLATFORM_NAME)\n"
|
||||
" set(PLATFORM_NAME " << platformName << ")\n"
|
||||
" endif()\n"
|
||||
"endif()\n\n"
|
||||
"if(NOT EFFECTIVE_PLATFORM_NAME)\n"
|
||||
" if(NOT \"$ENV{EFFECTIVE_PLATFORM_NAME}\" STREQUAL \"\")\n"
|
||||
" set(EFFECTIVE_PLATFORM_NAME \"$ENV{EFFECTIVE_PLATFORM_NAME}\")\n"
|
||||
" endif()\n"
|
||||
" if(NOT EFFECTIVE_PLATFORM_NAME)\n"
|
||||
" set(EFFECTIVE_PLATFORM_NAME -" << platformName << ")\n"
|
||||
" endif()\n"
|
||||
"endif()\n\n";
|
||||
/* clang-format off */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmLocalXCodeGenerator::ComputeObjectFilenames(
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
void AppendFlagEscape(std::string& flags,
|
||||
const std::string& rawFlag) const override;
|
||||
void Generate() override;
|
||||
virtual void GenerateInstallRules();
|
||||
void AddGeneratorSpecificInstallSetup(std::ostream& os) override;
|
||||
void ComputeObjectFilenames(
|
||||
std::map<cmSourceFile const*, std::string>& mapping,
|
||||
cmGeneratorTarget const* gt = nullptr) override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* Needed for glibc < 2.12 */
|
||||
# define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
#if !defined(_WIN32) && !defined(__sun)
|
||||
#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun)
|
||||
/* POSIX APIs are needed */
|
||||
# define _POSIX_C_SOURCE 200809L
|
||||
#endif
|
||||
|
||||
@@ -623,14 +623,14 @@ void cmVisualStudio10TargetGenerator::Generate()
|
||||
}
|
||||
|
||||
switch (this->ProjectType) {
|
||||
case vcxproj:
|
||||
if (this->GlobalGenerator->GetPlatformToolsetVersion()) {
|
||||
Elem(e0, "Import")
|
||||
.Attribute("Project",
|
||||
this->GlobalGenerator->GetAuxiliaryToolset());
|
||||
case vcxproj: {
|
||||
std::string const& props =
|
||||
this->GlobalGenerator->GetPlatformToolsetVersionProps();
|
||||
if (!props.empty()) {
|
||||
Elem(e0, "Import").Attribute("Project", props);
|
||||
}
|
||||
Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS);
|
||||
break;
|
||||
} break;
|
||||
case csproj:
|
||||
Elem(e0, "Import")
|
||||
.Attribute("Project", VS10_CSharp_DEFAULT_PROPS)
|
||||
|
||||
@@ -83,4 +83,30 @@ if(NOT XCODE OR NOT XCODE_VERSION VERSION_LESS 5)
|
||||
target_link_libraries(barStatic fooStatic)
|
||||
endif()
|
||||
|
||||
if(XCODE)
|
||||
add_library(space SHARED space.c)
|
||||
set_target_properties(space PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
OUTPUT_NAME "space space"
|
||||
)
|
||||
add_executable(use_space use_space.c)
|
||||
target_link_libraries(use_space PRIVATE space)
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
if(APPLE)
|
||||
set(ExternalFramework_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/External")
|
||||
file(REMOVE_RECURSE "${ExternalFramework_INSTALL_DIR}")
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(ExternalFramework
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External"
|
||||
INSTALL_DIR "${ExternalFramework_INSTALL_DIR}"
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
)
|
||||
|
||||
add_executable(useExternal useExternal.c)
|
||||
target_link_libraries(useExternal PRIVATE "${ExternalFramework_INSTALL_DIR}/lib/External.framework")
|
||||
add_dependencies(useExternal ExternalFramework)
|
||||
endif()
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
project(ExternalFramework C)
|
||||
add_library(External SHARED external.c)
|
||||
set_property(TARGET External PROPERTY FRAMEWORK 1)
|
||||
install(TARGETS External DESTINATION lib)
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
int external(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int space(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
extern int external(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return external();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
int space(void);
|
||||
int main(void)
|
||||
{
|
||||
return space();
|
||||
}
|
||||
@@ -1,8 +1,4 @@
|
||||
/*
|
||||
* Block comment
|
||||
*/
|
||||
{
|
||||
// Inline comment
|
||||
"version": 1,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,2 @@
|
||||
^CMake Error: Could not read presets from [^
|
||||
]*/Tests/RunCMake/CMakePresets/Comment: JSON parse error$
|
||||
@@ -0,0 +1,11 @@
|
||||
// Comment
|
||||
{
|
||||
"version": 1,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "Comment",
|
||||
"generator": "@RunCMake_GENERATOR@",
|
||||
"binaryDir": "${sourceDir}/build"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -77,6 +77,7 @@ endfunction()
|
||||
# Test CMakePresets.json errors
|
||||
set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
|
||||
run_cmake_presets(NoCMakePresets)
|
||||
run_cmake_presets(Comment)
|
||||
run_cmake_presets(JSONParseError)
|
||||
run_cmake_presets(InvalidRoot)
|
||||
run_cmake_presets(NoVersion)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import jsmin
|
||||
import json
|
||||
import jsonschema
|
||||
import os.path
|
||||
@@ -6,7 +5,7 @@ import sys
|
||||
|
||||
|
||||
with open(sys.argv[1], "rb") as f:
|
||||
contents = json.loads(jsmin.jsmin(f.read().decode("utf-8-sig")))
|
||||
contents = json.loads(f.read().decode("utf-8-sig"))
|
||||
|
||||
schema_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
|
||||
@@ -34,6 +34,7 @@ function(run_NoWorkToDo)
|
||||
run_cmake(NoWorkToDo)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoWorkToDo-build)
|
||||
set(RunCMake_TEST_OUTPUT_MERGE 1)
|
||||
run_cmake_command(NoWorkToDo-build ${CMAKE_COMMAND} --build .)
|
||||
run_cmake_command(NoWorkToDo-nowork ${CMAKE_COMMAND} --build . -- -d explain)
|
||||
endfunction()
|
||||
@@ -43,6 +44,7 @@ function(run_VerboseBuild)
|
||||
run_cmake(VerboseBuild)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
|
||||
set(RunCMake_TEST_OUTPUT_MERGE 1)
|
||||
run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
|
||||
run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
|
||||
endfunction()
|
||||
|
||||
@@ -139,6 +139,12 @@ function(run_cmake test)
|
||||
if(NOT "${actual_result}" MATCHES "${expect_result}")
|
||||
string(APPEND msg "Result is [${actual_result}], not [${expect_result}].\n")
|
||||
endif()
|
||||
|
||||
# Special case: remove ninja no-op line from stderr, but not stdout.
|
||||
# Test cases that look for it should use RunCMake_TEST_OUTPUT_MERGE.
|
||||
string(REGEX REPLACE "(^|\r?\n)ninja: no work to do\\.\r?\n" "\\1" actual_stderr "${actual_stderr}")
|
||||
|
||||
# Remove incidental content from both stdout and stderr.
|
||||
string(CONCAT ignore_line_regex
|
||||
"(^|\n)((==[0-9]+=="
|
||||
"|BullseyeCoverage"
|
||||
|
||||
@@ -206,7 +206,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
endif()
|
||||
|
||||
if(XCODE_VERSION VERSION_GREATER_EQUAL 6 AND XCODE_VERSION VERSION_LESS 12)
|
||||
if(XCODE_VERSION VERSION_GREATER_EQUAL 6)
|
||||
# XcodeIOSInstallCombined
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
@@ -220,7 +220,14 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 6 AND XCODE_VERSION VERSION_LESS 12)
|
||||
|
||||
run_cmake(XcodeIOSInstallCombined)
|
||||
run_cmake_command(XcodeIOSInstallCombined-build ${CMAKE_COMMAND} --build .)
|
||||
run_cmake_command(XcodeIOSInstallCombined-install ${CMAKE_COMMAND} --build . --target install)
|
||||
if(XCODE_VERSION VERSION_LESS 12)
|
||||
run_cmake_command(XcodeIOSInstallCombined-install ${CMAKE_COMMAND} --build . --target install)
|
||||
endif()
|
||||
# --build defaults to Debug, --install defaults to Release, so we have to
|
||||
# specify the configuration explicitly
|
||||
run_cmake_command(XcodeIOSInstallCombined-cmakeinstall
|
||||
${CMAKE_COMMAND} --install . --config Debug
|
||||
)
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
unset(RunCMake_TEST_NO_CLEAN)
|
||||
@@ -239,7 +246,14 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 6 AND XCODE_VERSION VERSION_LESS 12)
|
||||
|
||||
run_cmake(XcodeIOSInstallCombinedPrune)
|
||||
run_cmake_command(XcodeIOSInstallCombinedPrune-build ${CMAKE_COMMAND} --build .)
|
||||
run_cmake_command(XcodeIOSInstallCombinedPrune-install ${CMAKE_COMMAND} --build . --target install)
|
||||
if(XCODE_VERSION VERSION_LESS 12)
|
||||
run_cmake_command(XcodeIOSInstallCombinedPrune-install ${CMAKE_COMMAND} --build . --target install)
|
||||
endif()
|
||||
# --build defaults to Debug, --install defaults to Release, so we have to
|
||||
# specify the configuration explicitly
|
||||
run_cmake_command(XcodeIOSInstallCombinedPrune-cmakeinstall
|
||||
${CMAKE_COMMAND} --install . --config Debug
|
||||
)
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
unset(RunCMake_TEST_NO_CLEAN)
|
||||
@@ -258,7 +272,14 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 6 AND XCODE_VERSION VERSION_LESS 12)
|
||||
|
||||
run_cmake(XcodeIOSInstallCombinedSingleArch)
|
||||
run_cmake_command(XcodeIOSInstallCombinedSingleArch-build ${CMAKE_COMMAND} --build .)
|
||||
run_cmake_command(XcodeIOSInstallCombinedSingleArch-install ${CMAKE_COMMAND} --build . --target install)
|
||||
if(XCODE_VERSION VERSION_LESS 12)
|
||||
run_cmake_command(XcodeIOSInstallCombinedSingleArch-install ${CMAKE_COMMAND} --build . --target install)
|
||||
endif()
|
||||
# --build defaults to Debug, --install defaults to Release, so we have to
|
||||
# specify the configuration explicitly
|
||||
run_cmake_command(XcodeIOSInstallCombinedSingleArch-cmakeinstall
|
||||
${CMAKE_COMMAND} --install . --config Debug
|
||||
)
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
unset(RunCMake_TEST_NO_CLEAN)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Expect the same results whether installing directly or via cmake --install
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/XcodeIOSInstallCombined-install-check.cmake)
|
||||
@@ -0,0 +1,2 @@
|
||||
# Expect the same results whether installing directly or via cmake --install
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/XcodeIOSInstallCombinedSingleArch-install-check.cmake)
|
||||
@@ -148,6 +148,27 @@ set(_check
|
||||
)
|
||||
check_contents(deps/udeps6.txt "^${_check}$")
|
||||
|
||||
# Weak library reference should have exactly the same dependencies as a regular library reference (test 1)
|
||||
set_with_libsystem(_check
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
|
||||
[[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
|
||||
)
|
||||
check_contents(deps/deps7.txt "^${_check}$")
|
||||
|
||||
set(_check
|
||||
[[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
|
||||
[[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
|
||||
[[@rpath/librpath_executable_path_bundle\.dylib]]
|
||||
[[@rpath/librpath_loader_path_unresolved\.dylib]]
|
||||
[[@rpath/librpath_unresolved\.dylib]]
|
||||
)
|
||||
check_contents(deps/udeps7.txt "^${_check}$")
|
||||
|
||||
set(_check
|
||||
"^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$"
|
||||
)
|
||||
@@ -157,3 +178,4 @@ check_contents(deps/cdeps3.txt "${_check}")
|
||||
check_contents(deps/cdeps4.txt "${_check}")
|
||||
check_contents(deps/cdeps5.txt "${_check}")
|
||||
check_contents(deps/cdeps6.txt "${_check}")
|
||||
check_contents(deps/cdeps7.txt "${_check}")
|
||||
|
||||
@@ -128,16 +128,19 @@ endforeach()
|
||||
target_link_libraries(testlib PRIVATE ${testlib_names})
|
||||
|
||||
add_executable(topexe macos/topexe.c)
|
||||
add_executable(topexe_weak macos/topexe.c)
|
||||
add_library(toplib SHARED macos/toplib.c)
|
||||
add_library(topmod MODULE macos/toplib.c)
|
||||
target_link_libraries(topexe PRIVATE testlib)
|
||||
target_link_libraries(topexe_weak PRIVATE "-weak_library" testlib)
|
||||
target_link_libraries(toplib PRIVATE testlib)
|
||||
target_link_libraries(topmod PRIVATE testlib)
|
||||
|
||||
set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib")
|
||||
set_property(TARGET topexe_weak toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib")
|
||||
|
||||
install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib)
|
||||
install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib)
|
||||
install(TARGETS topexe topexe_weak toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib)
|
||||
install(TARGETS topexe topexe_weak toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib)
|
||||
|
||||
install(CODE [[
|
||||
function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
|
||||
@@ -213,4 +216,12 @@ install(CODE [[
|
||||
"${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
|
||||
BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
|
||||
)
|
||||
|
||||
exec_get_runtime_dependencies(
|
||||
deps7.txt udeps7.txt cdeps7.txt
|
||||
EXECUTABLES
|
||||
"${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe_weak>"
|
||||
LIBRARIES
|
||||
"${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
|
||||
)
|
||||
]])
|
||||
|
||||
@@ -93,7 +93,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
|
||||
message(STATUS "RerunCMake: first configuration...")
|
||||
run_cmake(RerunCMake)
|
||||
if(NOT CMake_TEST_FILESYSTEM_1S)
|
||||
set(RunCMake_TEST_OUTPUT_MERGE 1)
|
||||
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
|
||||
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
|
||||
@@ -101,7 +103,9 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
|
||||
file(WRITE "${in_tc}" "does-not-compile\n")
|
||||
run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
|
||||
if(NOT CMake_TEST_FILESYSTEM_1S)
|
||||
set(RunCMake_TEST_OUTPUT_MERGE 1)
|
||||
run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
|
||||
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||
endif()
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
|
||||
Reference in New Issue
Block a user