diff options
22 files changed, 187 insertions, 43 deletions
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 73356d9..c871b1b 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -1449,7 +1449,7 @@ Output-Related Expressions .. versionadded:: 3.24 Manage the grouping of libraries during the link step. - This expression may be used to specify how to kept groups of libraries during + This expression may be used to specify how to keep groups of libraries during the link of a target. For example: diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d99afe3..43eb200 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -59,7 +59,7 @@ Policies Introduced by CMake 3.24 :maxdepth: 1 CMP0139: The if() command supports path comparisons using PATH_EQUAL operator. </policy/CMP0139> - CMP0138: Placeholder for reverted policy. </policy/CMP0138> + CMP0138: CheckIPOSupported uses flags from calling project. </policy/CMP0138> CMP0137: try_compile() passes platform variables in project mode. </policy/CMP0137> CMP0136: Watcom runtime library flags are selected by an abstraction. </policy/CMP0136> CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135> diff --git a/Help/policy/CMP0138.rst b/Help/policy/CMP0138.rst index c7f0e2d..a86849d 100644 --- a/Help/policy/CMP0138.rst +++ b/Help/policy/CMP0138.rst @@ -3,7 +3,25 @@ CMP0138 .. versionadded:: 3.24 -Placeholder for reverted policy. +:module:`CheckIPOSupported` uses flags from calling project. + +The :module:`CheckIPOSupported` module :command:`check_ipo_supported` +command compiles a test project to determine whether the toolchain +supports :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION`. CMake 3.23 and +below run the check with the default values of the +:variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` +variables for the current environment and toolchain settings. +However, some projects may modify these flag variables to add +flags that affect availability of the toolchain's IPO features. +CMake 3.24 and above prefer to honor the calling project's values +for these variables. This policy provides compatibility for projects +that have not been updated to expect this behavior. + +The ``OLD`` behavior for this policy is to ignore the calling +project's values of :variable:`CMAKE_<LANG>_FLAGS` and +:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`. The ``NEW`` behavior +for this policy is to use the values of those variables as +compiler flags in the test project. This policy was introduced in CMake version 3.24. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. diff --git a/Help/release/3.24.rst b/Help/release/3.24.rst index f347acb..d0db764 100644 --- a/Help/release/3.24.rst +++ b/Help/release/3.24.rst @@ -28,14 +28,16 @@ Generators * The :generator:`Green Hills MULTI` generator now generates build rules to re-run CMake if any CMake files are updated. -* The :ref:`Visual Studio Generators` now support ``SYSTEM`` headers. +* The :ref:`Visual Studio Generators` now support ``SYSTEM`` headers + when using VS 2019 Update 11 or later. Command-Line ------------ * :manual:`cmake(1)` gained the ``--fresh`` command-line option to remove - any existing ``CMakeCache.txt`` when configuring a build tree, thus - starting a new configuration as if the build tree were freshly created. + any existing ``CMakeCache.txt`` file and associated ``CMakeFiles/`` + directory, when configuring a build tree, thus starting a new configuration + as if the build tree were freshly created. * :manual:`cmake(1)` gained the ``--compile-no-warning-as-error`` command-line option which causes the effects of the :prop_tgt:`COMPILE_WARNING_AS_ERROR` @@ -93,14 +95,14 @@ Commands ``RANGE_END`` to specify a range of bytes to download. This can be useful for downloading parts of big binary files. -* The :command:`find_file`, :command:`find_library`, :command:`find_path`, - :command:`find_package`, and :command:`find_program` commands have gained - the ``NO_CMAKE_INSTALL_PREFIX`` option to control searching +* The :command:`find_file`, :command:`find_path`, :command:`find_library`, + :command:`find_program`, and :command:`find_package` commands gained the + ``NO_CMAKE_INSTALL_PREFIX`` option to control searching :variable:`CMAKE_INSTALL_PREFIX`. * The :command:`find_file`, :command:`find_path`, :command:`find_library`, :command:`find_program`, and :command:`find_package` commands gained the - capability to specify which Windows Registry views must be queried. + ability to specify which Windows Registry views must be queried. * The :command:`find_package` command gained a ``GLOBAL`` option that allows for the promotion of imported targets to global scope for the @@ -117,7 +119,7 @@ Variables color build system messages with :ref:`Makefile Generators`, replacing :variable:`CMAKE_COLOR_MAKEFILE`. - The :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment was added to set + The :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment variable was added to set a default value for :variable:`CMAKE_COLOR_DIAGNOSTICS`. * The :variable:`CMAKE_COMPILE_WARNING_AS_ERROR` variable and corresponding @@ -230,9 +232,9 @@ Generator Expressions * The :genex:`LINK_LIBRARY` generator expression was added to manage how libraries are specified during the link step. - The variables :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` and - :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` are used to define features - usable by the :genex:`LINK_LIBRARY` generator expression. + The :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` and + :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variables are used to define + features usable by the :genex:`LINK_LIBRARY` generator expression. Moreover, the :prop_tgt:`LINK_LIBRARY_OVERRIDE` and :prop_tgt:`LINK_LIBRARY_OVERRIDE_<LIBRARY>` target properties are available to resolve incompatible features. @@ -267,14 +269,13 @@ Generator Expressions * ``MSYS`` * The :genex:`LINK_GROUP` generator expression was added to manage the - grouping of libraries during the link step. The variables + grouping of libraries during the link step. The :variable:`CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>` and - :variable:`CMAKE_LINK_GROUP_USING_<FEATURE>` are used to define - features usable by the :genex:`LINK_GROUP` generator expression. - - The :genex:`LINK_GROUP` generator expression can manage, on ``Linux`` - and ``BSD`` systems, circular references among static libraries - by using the ``RESCAN`` feature. + :variable:`CMAKE_LINK_GROUP_USING_<FEATURE>` variables are used to define + features usable with the :genex:`LINK_GROUP` generator expression. + This release defines the ``RESCAN`` feature, which can be used to handle + circular references among static libraries when using toolchains for + Linux, BSD, SunOS and GNU toolchains for Windows. * The :genex:`PATH` generator expression was added to manage paths. @@ -302,7 +303,7 @@ CPack * CPack now supports the :variable:`CPACK_THREADS` option for ``zstd`` compression when compiled with libarchive 3.6 or higher. It is - supported by official CMake binaries available on ``cmake.org``. + supported by official CMake binaries available on `cmake.org`_. Deprecated and Removed Features =============================== @@ -314,7 +315,7 @@ Deprecated and Removed Features * The deprecated :cpack_gen:`CPack PackageMaker Generator` has been removed. * The :module:`FindGLUT` module no longer provides the undocumented - result variables ``GLUT_LIBRARY`` and ``GLUT_INCLUDE_PATH``. + ``GLUT_LIBRARY`` and ``GLUT_INCLUDE_PATH`` result variables. Other Changes ============= @@ -323,6 +324,11 @@ Other Changes etc. when enabling the corresponding language during the first CMake run in a build directory. See policy :policy:`CMP0132`. +* The :module:`CheckIPOSupported` module :command:`check_ipo_supported` + command now uses the caller's :variable:`CMAKE_<LANG>_FLAGS` + and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values. + See policy :policy:`CMP0138`. + * The :generator:`MSYS Makefiles` and :generator:`MinGW Makefiles` generators, when a compiler is not explicitly specified, now select the first compiler (of any name) found in directories listed by the @@ -335,7 +341,8 @@ Other Changes * The :command:`while` command now diagnoses errors during condition evaluation. See policy :policy:`CMP0130`. -* The precompiled macOS binaries provided on - `cmake.org <https://cmake.org/download/>`_ no longer attach a SLA - to the ``.dmg`` packages. This was removed because macOS 12 deprecated +* The precompiled macOS binaries provided on `cmake.org`_ no longer attach a + SLA to the ``.dmg`` packages. This was removed because macOS 12 deprecated the tools used to attach ``.dmg`` resources. + +.. _`cmake.org`: https://cmake.org/download/ diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 0e8b2af..2b19736 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -611,6 +611,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]") + set(id_code_sign_identity "-") # When targeting macOS, use only the host architecture. if (_CMAKE_APPLE_ARCHS_DEFAULT) set(id_archs "ARCHS = \"${_CMAKE_APPLE_ARCHS_DEFAULT}\";") @@ -620,6 +621,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") endif() else() + set(id_code_sign_identity "") set(id_archs "") set(id_arch_active "ONLY_ACTIVE_ARCH = YES;") endif() diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index 0bc3c92..cca1be9 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -36,6 +36,11 @@ module will return error in this case. See policy :policy:`CMP0069` for details. .. versionadded:: 3.13 Add support for Visual Studio generators. +.. versionadded:: 3.24 + The check uses the caller's :variable:`CMAKE_<LANG>_FLAGS` + and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values. + See policy :policy:`CMP0138`. + Examples ^^^^^^^^ @@ -117,6 +122,16 @@ macro(_ipo_run_language_check language) ) endforeach() + if(ipo_CMP0138 STREQUAL "NEW") + set(CMAKE_TRY_COMPILE_CONFIGURATION Debug) + set(_CMAKE_LANG_FLAGS + "-DCMAKE_${language}_FLAGS:STRING=${CMAKE_${language}_FLAGS}" + "-DCMAKE_${language}_FLAGS_DEBUG:STRING=${CMAKE_${language}_FLAGS_DEBUG}" + ) + else() + set(_CMAKE_LANG_FLAGS "") + endif() + try_compile( _IPO_LANGUAGE_CHECK_RESULT "${bindir}" @@ -125,6 +140,7 @@ macro(_ipo_run_language_check language) CMAKE_FLAGS "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" + ${_CMAKE_LANG_FLAGS} OUTPUT_VARIABLE output ) set(_IPO_LANGUAGE_CHECK_RESULT "${_IPO_LANGUAGE_CHECK_RESULT}") @@ -155,6 +171,11 @@ function(check_ipo_supported) message(FATAL_ERROR "Policy CMP0069 set to OLD") endif() + # Save policy setting for condition in _ipo_run_language_check. + cmake_policy(GET CMP0138 ipo_CMP0138 + PARENT_SCOPE # undocumented, do not use outside of CMake + ) + set(optional) set(one RESULT OUTPUT) set(multiple LANGUAGES) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index aab357a..43e8cc8 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -49,6 +49,7 @@ }; 2C8FEB8E15DC1A1A00E56A5D = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -72,7 +73,7 @@ 1DEB928608733DD80010E9CD = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "@id_code_sign_identity@"; PRODUCT_NAME = CompilerId@id_lang@; }; name = Debug; diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index e19b7c9..701e5fb 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2063,19 +2063,19 @@ endif() set(${cmd_var} "${command}" PARENT_SCOPE) endfunction() -# This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced -# makefiles with "/./" in paths for custom command dependencies. Which -# resulted in problems with parallel make -j invocations. -# -# This function was added so that the suffix (search below for ${cfgdir}) is -# only set to "/${CMAKE_CFG_INTDIR}" when ${CMAKE_CFG_INTDIR} is not going to -# be "." (multi-configuration build systems like Visual Studio and Xcode...) -# -function(_ep_get_configuration_subdir_suffix suffix_var) +# On multi-config generators, provide a placeholder for a per-config subdir. +# On single-config generators, this is empty. +function(_ep_get_configuration_subdir_genex suffix_var) set(suffix "") get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(suffix "/${CMAKE_CFG_INTDIR}") + if(CMAKE_GENERATOR STREQUAL "Xcode") + # The Xcode generator does not support per-config sources, + # so use the underlying build system's placeholder instead. + set(suffix "/${CMAKE_CFG_INTDIR}") + else() + set(suffix "/$<CONFIG>") + endif() endif() set(${suffix_var} "${suffix}" PARENT_SCOPE) endfunction() @@ -2088,7 +2088,7 @@ function(_ep_get_step_stampfile ) ExternalProject_Get_Property(${name} stamp_dir) - _ep_get_configuration_subdir_suffix(cfgdir) + _ep_get_configuration_subdir_genex(cfgdir) set(stampfile "${stamp_dir}${cfgdir}/${name}-${step}") set(${stampfile_var} "${stampfile}" PARENT_SCOPE) @@ -2100,7 +2100,7 @@ function(_ep_get_complete_stampfile stampfile_var ) set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) - _ep_get_configuration_subdir_suffix(cfgdir) + _ep_get_configuration_subdir_genex(cfgdir) set(stampfile "${cmf_dir}${cfgdir}/${name}-complete") set(${stampfile_var} ${stampfile} PARENT_SCOPE) @@ -2423,18 +2423,25 @@ function(ExternalProject_Add_Step name step) PROPERTY _EP_${step}_ALWAYS ) if(always) - set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) set(touch) + # Mark stamp files for all configs as SYMBOLIC since we do not create them. # Remove any existing stamp in case the option changed in an existing tree. get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) + _ep_get_configuration_subdir_genex(cfgdir) foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) - string(REPLACE "/${CMAKE_CFG_INTDIR}" "/${cfg}" + string(REPLACE "${cfgdir}" "/${cfg}" stamp_file_config "${stamp_file}" ) + set_property(SOURCE ${stamp_file_config} PROPERTY SYMBOLIC 1) file(REMOVE ${stamp_file_config}) endforeach() + if(CMAKE_GENERATOR STREQUAL "Xcode") + # See Xcode case in _ep_get_configuration_subdir_genex. + set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) + endif() else() + set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) file(REMOVE ${stamp_file}) endif() else() @@ -3940,7 +3947,7 @@ function(ExternalProject_Add name) PARENT_SCOPE # undocumented, do not use outside of CMake ) - _ep_get_configuration_subdir_suffix(cfgdir) + _ep_get_configuration_subdir_genex(cfgdir) # Add a custom target for the external project. set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 72a169a..cb7402c 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -415,7 +415,8 @@ class cmMakefile; SELECT(POLICY, CMP0137, \ "try_compile() passes platform variables in project mode", 3, 24, 0, \ cmPolicies::WARN) \ - SELECT(POLICY, CMP0138, "Placeholder for reverted policy.", 3, 24, 0, \ + SELECT(POLICY, CMP0138, \ + "CheckIPOSupported uses flags from calling project.", 3, 24, 0, \ cmPolicies::WARN) \ SELECT( \ POLICY, CMP0139, \ diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index c38b456..5889a4b 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -94,6 +94,13 @@ # include <linux/fs.h> #endif +#if defined(__APPLE__) && \ + (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - 0 >= 101200) +# define KWSYS_SYSTEMTOOLS_HAVE_MACOS_COPYFILE_CLONE +# include <copyfile.h> +# include <sys/stat.h> +#endif + // Windows API. #if defined(_WIN32) # include <windows.h> @@ -2474,6 +2481,26 @@ Status SystemTools::CloneFileContent(std::string const& source, close(out); return status; +#elif defined(__APPLE__) && \ + defined(KWSYS_SYSTEMTOOLS_HAVE_MACOS_COPYFILE_CLONE) + // NOTE: we cannot use `clonefile` as the {a,c,m}time for the file needs to + // be updated by `copy_file_if_different` and `copy_file`. + if (copyfile(source.c_str(), destination.c_str(), nullptr, + COPYFILE_METADATA | COPYFILE_CLONE) < 0) { + return Status::POSIX_errno(); + } +# if KWSYS_CXX_HAS_UTIMENSAT + // utimensat is only available on newer Unixes and macOS 10.13+ + if (utimensat(AT_FDCWD, destination.c_str(), nullptr, 0) < 0) { + return Status::POSIX_errno(); + } +# else + // fall back to utimes + if (utimes(destination.c_str(), nullptr) < 0) { + return Status::POSIX_errno(); + } +# endif + return Status::Success(); #else (void)source; (void)destination; diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-Common.cmake b/Tests/RunCMake/CheckIPOSupported/CMP0138-Common.cmake new file mode 100644 index 0000000..508e6c3 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-Common.cmake @@ -0,0 +1,9 @@ +enable_language(C) +string(APPEND CMAKE_C_FLAGS " -DFOO") +string(APPEND CMAKE_C_FLAGS_DEBUG " -DBAR") +check_ipo_supported(RESULT ipo_supported) +file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/_CMakeLTOTest-C/bin/CMakeCache.txt" + cached_flags REGEX "^CMAKE_C_FLAGS(_DEBUG)?:") +foreach(line IN LISTS cached_flags) + message(STATUS "${line}") +endforeach() diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW-stdout.txt b/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW-stdout.txt new file mode 100644 index 0000000..aa150a8 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW-stdout.txt @@ -0,0 +1,5 @@ +-- CMAKE_C_FLAGS:STRING=[^ +]*-DFOO +-- CMAKE_C_FLAGS_DEBUG:STRING=[^ +]*-DBAR +-- diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW.cmake b/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW.cmake new file mode 100644 index 0000000..6611504 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0138 NEW) +include(CMP0138-Common.cmake) diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD-stdout.txt b/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD-stdout.txt new file mode 100644 index 0000000..c80b208 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD-stdout.txt @@ -0,0 +1,3 @@ +-- CMAKE_C_FLAGS:STRING=([^-]|-[^D]|-D[^F]|-DF[^O]|-DFO[^O])* +-- CMAKE_C_FLAGS_DEBUG:STRING=([^-]|-[^D]|-D[^B]|-DB[^A]|-DBA[^R])* +-- diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD.cmake b/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD.cmake new file mode 100644 index 0000000..b16ac9f --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0138 OLD) +include(CMP0138-Common.cmake) diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN-stdout.txt b/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN-stdout.txt new file mode 100644 index 0000000..c80b208 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN-stdout.txt @@ -0,0 +1,3 @@ +-- CMAKE_C_FLAGS:STRING=([^-]|-[^D]|-D[^F]|-DF[^O]|-DFO[^O])* +-- CMAKE_C_FLAGS_DEBUG:STRING=([^-]|-[^D]|-D[^B]|-DB[^A]|-DBA[^R])* +-- diff --git a/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN.cmake b/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN.cmake new file mode 100644 index 0000000..01118ee --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/CMP0138-WARN.cmake @@ -0,0 +1,2 @@ +# (leave CMP0138 unset) +include(CMP0138-Common.cmake) diff --git a/Tests/RunCMake/CheckIPOSupported/Inspect.cmake b/Tests/RunCMake/CheckIPOSupported/Inspect.cmake new file mode 100644 index 0000000..07e4258 --- /dev/null +++ b/Tests/RunCMake/CheckIPOSupported/Inspect.cmake @@ -0,0 +1,5 @@ +enable_language(C) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" " +set(_CMAKE_C_IPO_SUPPORTED_BY_CMAKE \"${_CMAKE_C_IPO_SUPPORTED_BY_CMAKE}\") +set(_CMAKE_C_IPO_MAY_BE_SUPPORTED_BY_COMPILER \"${_CMAKE_C_IPO_MAY_BE_SUPPORTED_BY_COMPILER}\") +") diff --git a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake index b7d524c..2fb159e 100644 --- a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake @@ -1,5 +1,8 @@ include(RunCMake) +run_cmake(Inspect) +include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") + run_cmake(unparsed-arguments) run_cmake(user-lang-unknown) run_cmake(default-lang-none) @@ -8,6 +11,14 @@ run_cmake(not-supported-by-compiler) run_cmake(save-to-result) run_cmake(cmp0069-is-old) +if(_CMAKE_C_IPO_SUPPORTED_BY_CMAKE + AND _CMAKE_C_IPO_MAY_BE_SUPPORTED_BY_COMPILER + AND NOT RunCMake_GENERATOR MATCHES "^Visual Studio 9 ") + run_cmake(CMP0138-WARN) + run_cmake(CMP0138-OLD) + run_cmake(CMP0138-NEW) +endif() + if(RunCMake_GENERATOR MATCHES "^Visual Studio 9 ") run_cmake(not-supported-by-generator) endif() diff --git a/Tests/RunCMake/NinjaMultiConfig/ExternalProject.cmake b/Tests/RunCMake/NinjaMultiConfig/ExternalProject.cmake new file mode 100644 index 0000000..7948133 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/ExternalProject.cmake @@ -0,0 +1,9 @@ +include(ExternalProject) +ExternalProject_Add(proj1 + DOWNLOAD_COMMAND "" + SOURCE_DIR "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "Configure proj1" + BUILD_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/out-$<CONFIG>.txt + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/out-$<CONFIG>.txt + INSTALL_COMMAND "" +) diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index dbc3151..738bc6c 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -432,6 +432,13 @@ run_cmake_configure(ExcludeFromAll) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_cmake_build(ExcludeFromAll all "" all:all) +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExternalProject-build) +set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all;-DCMAKE_DEFAULT_CONFIGS=Debug\\;Release") +run_cmake_configure(ExternalProject) +unset(RunCMake_TEST_OPTIONS) +run_cmake_build(ExternalProject release-in-debug-graph "Debug" all:Release) +run_cmake_build(ExternalProject debug-in-release-graph "Release" all:Debug) + # FIXME Get this working #set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutoMocExecutable-build) #run_cmake_configure(AutoMocExecutable) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index f232b1b..1c92ca0 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -165,7 +165,9 @@ function(run_cmake test) "|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:" "|[^\n]*xcodebuild[^\n]*DVTPlugInManager" + "|[^\n]*xcodebuild[^\n]*DVTSDK: Warning: SDK path collision for path" "|[^\n]*xcodebuild[^\n]*Requested but did not find extension point with identifier" + "|[^\n]*xcodebuild[^\n]*nil host used in call to allows.*HTTPSCertificateForHost" "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" "|[^\n]*objc[^\n]*: Class [^\n]* One of the two will be used. Which one is undefined." "|[^\n]*is a member of multiple groups" |