From ad6a9f5a6ef0be056459090aa0aabd938a470c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Sun, 8 Oct 2023 23:30:20 +0200 Subject: [PATCH] New upstream version 3.27.7 --- Help/manual/ctest.1.rst | 3 +- Help/policy/CMP0124.rst | 42 ++++++++++++++++--- Help/release/3.27.rst | 4 +- Modules/Compiler/Clang.cmake | 9 +++- Modules/FindPostgreSQL.cmake | 4 +- Source/CMakeVersion.cmake | 4 +- Source/CTest/cmCTestRunTest.cxx | 11 ++--- Source/cmCommonTargetGenerator.cxx | 5 +-- ...stdout.txt => FlagOverridesVar-stdout.txt} | 2 +- .../PropertyOverridesVar-stdout.txt | 6 +++ .../RunCMake/CTestTimeout/RunCMakeTest.cmake | 9 +++- Tests/RunCMake/MultiLint/RunCMakeTest.cmake | 1 + Tests/RunCMake/MultiLint/genex.cmake | 6 +++ 13 files changed, 82 insertions(+), 24 deletions(-) rename Tests/RunCMake/CTestTimeout/{PropertyOverridesScript-stdout.txt => FlagOverridesVar-stdout.txt} (72%) create mode 100644 Tests/RunCMake/CTestTimeout/PropertyOverridesVar-stdout.txt create mode 100644 Tests/RunCMake/MultiLint/genex.cmake diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 994ae47b7..5c3889e3b 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -1230,7 +1230,8 @@ Configuration settings include: ``TimeOut`` The default timeout for each test if not specified by the - :prop_test:`TIMEOUT` test property. + :prop_test:`TIMEOUT` test property or the + :option:`--timeout ` flag. * `CTest Script`_ variable: :variable:`CTEST_TEST_TIMEOUT` * :module:`CTest` module variable: ``DART_TESTING_TIMEOUT`` diff --git a/Help/policy/CMP0124.rst b/Help/policy/CMP0124.rst index 3935166ad..d5cde64d4 100644 --- a/Help/policy/CMP0124.rst +++ b/Help/policy/CMP0124.rst @@ -3,12 +3,44 @@ CMP0124 .. versionadded:: 3.21 -When this policy is set to ``NEW``, the scope of loop variables defined by the -:command:`foreach` command is restricted to the loop only. They will be unset -at the end of the loop. +:command:`foreach` loop variables are only available in the loop scope. -The ``OLD`` behavior for this policy still clears the loop variables at the end -of the loop, but does not unset them. This leaves them as defined, but empty. +CMake 3.20 and below always leave the loop variable set at the end of the +loop, either to the value it had before the loop, if any, or to the empty +string. CMake 3.21 and above prefer to leave the loop variable in the +state it had before the loop started, either set or unset. This policy +provides compatibility for projects that expect the loop variable to always +be left set. + +The ``OLD`` behavior for this policy is to set the loop variable at the +end of the loop, either to its original value, or to an empty value. +The ``NEW`` behavior for this policy is to restore the loop variable to +the state it had before the loop started, either set or unset. + +For example: + +.. code-block:: cmake + + set(items a b c) + + set(var1 "value") + unset(var2) + + foreach(var1 IN LISTS items) + endforeach() + + foreach(var2 IN LISTS items) + endforeach() + + if(DEFINED var1) + message("var1: ${var1}") + endif() + if(DEFINED var2) + message("var2: ${var2}") + endif() + +Under the ``OLD`` behavior, this code prints ``var1: value`` and ``var2:``. +Under the ``NEW`` behavior, this code prints only ``var1: value``. This policy was introduced in CMake version 3.21. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. diff --git a/Help/release/3.27.rst b/Help/release/3.27.rst index e0b72cd27..2ba0c7dd9 100644 --- a/Help/release/3.27.rst +++ b/Help/release/3.27.rst @@ -285,8 +285,8 @@ Changes made since CMake 3.27.0 include the following. to select the Windows 8.1 SDK. In CMake 3.27.[0-1] the ``version=`` field was limited to selecting Windows 10 SDKs. -3.27.3, 3.27.4, 3.27.5, 3.27.6 ------------------------------- +3.27.3, 3.27.4, 3.27.5, 3.27.6, 3.27.7 +-------------------------------------- * These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 46f5fc194..e5683c2c0 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -173,7 +173,12 @@ macro(__compiler_clang_cxx_standards lang) unset(_clang_version_std17) - if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 17.0) + set(_clang_version_std23 17.0) + if(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(_clang_version_std23 18.0) + endif() + + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std23}") set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23") set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++23") set(CMAKE_${lang}26_STANDARD_COMPILE_OPTION "-std=c++26") @@ -183,6 +188,8 @@ macro(__compiler_clang_cxx_standards lang) set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++2b") endif() + unset(_clang_version_std23) + if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") # The MSVC standard library requires C++14, and MSVC itself has no # notion of operating in a mode not aware of at least that standard. diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 6e970e843..84bc1ed2b 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -53,7 +53,7 @@ is set regardless of the presence of the ``Server`` component in find_package ca # In Windows the default installation of PostgreSQL uses that as part of the path. # E.g C:\Program Files\PostgreSQL\8.4. # Currently, the following version numbers are known to this module: -# "15" "14" "13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0" +# "16" "15" "14" "13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0" # # To use this variable just do something like this: # set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4") @@ -102,7 +102,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} - "15" "14" "13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") + "16" "15" "14" "13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") # Define additional search paths for root directories. set( PostgreSQL_ROOT_DIRECTORIES diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fc738def3..f34505fcd 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 27) -set(CMake_VERSION_PATCH 6) +set(CMake_VERSION_PATCH 7) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) @@ -21,7 +21,7 @@ endif() if(NOT CMake_VERSION_NO_GIT) # If this source was exported by 'git archive', use its commit info. - set(git_info [==[51b34a5483 CMake 3.27.6]==]) + set(git_info [==[9532e1cf5b CMake 3.27.7]==]) # Otherwise, try to identify the current development source version. if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 563439acd..19e505fcf 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -768,11 +768,12 @@ bool cmCTestRunTest::ForkProcess() timeout = this->CTest->GetGlobalTimeout(); } - // Check CTEST_TEST_TIMEOUT. - cmDuration ctestTestTimeout = this->CTest->GetTimeOut(); - if (ctestTestTimeout > cmDuration::zero() && - (!timeout || ctestTestTimeout < *timeout)) { - timeout = ctestTestTimeout; + if (!timeout) { + // Check CTEST_TEST_TIMEOUT. + cmDuration ctestTestTimeout = this->CTest->GetTimeOut(); + if (ctestTestTimeout > cmDuration::zero()) { + timeout = ctestTestTimeout; + } } } diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 1924235dd..c78113766 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -335,10 +335,7 @@ std::string cmCommonTargetGenerator::GenerateCodeCheckRules( auto evaluatedProp = cmGeneratorExpression::Evaluate( *value, this->GeneratorTarget->GetLocalGenerator(), config, this->GeneratorTarget, nullptr, this->GeneratorTarget, lang); - if (!evaluatedProp.empty()) { - return evaluatedProp; - } - return *value; + return evaluatedProp; }; std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY"); tidy = evaluateProp(tidy_prop); diff --git a/Tests/RunCMake/CTestTimeout/PropertyOverridesScript-stdout.txt b/Tests/RunCMake/CTestTimeout/FlagOverridesVar-stdout.txt similarity index 72% rename from Tests/RunCMake/CTestTimeout/PropertyOverridesScript-stdout.txt rename to Tests/RunCMake/CTestTimeout/FlagOverridesVar-stdout.txt index 6e4648575..f58087163 100644 --- a/Tests/RunCMake/CTestTimeout/PropertyOverridesScript-stdout.txt +++ b/Tests/RunCMake/CTestTimeout/FlagOverridesVar-stdout.txt @@ -1,5 +1,5 @@ Test project [^ -]*/Tests/RunCMake/CTestTimeout/PropertyOverridesScript-build +]*/Tests/RunCMake/CTestTimeout/FlagOverridesVar-build Start 1: TestTimeout 1/1 Test #1: TestTimeout ...................... Passed +[1-9][0-9.]* sec + diff --git a/Tests/RunCMake/CTestTimeout/PropertyOverridesVar-stdout.txt b/Tests/RunCMake/CTestTimeout/PropertyOverridesVar-stdout.txt new file mode 100644 index 000000000..aeeb3c9c3 --- /dev/null +++ b/Tests/RunCMake/CTestTimeout/PropertyOverridesVar-stdout.txt @@ -0,0 +1,6 @@ +Test project [^ +]*/Tests/RunCMake/CTestTimeout/PropertyOverridesVar-build + Start 1: TestTimeout +1/1 Test #1: TestTimeout ...................... Passed +[1-9][0-9.]* sec ++ +100% tests passed, 0 tests failed out of 1 diff --git a/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake b/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake index 2f9eda121..470bbd890 100644 --- a/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake @@ -92,5 +92,12 @@ block() set(TIMEOUT 4) set(CASE_TEST_PREFIX_CODE "set(CTEST_TEST_TIMEOUT 2)") set(CASE_CMAKELISTS_SUFFIX_CODE "set_property(TEST TestTimeout PROPERTY TIMEOUT 10)\n") - run_ctest_timeout(PropertyOverridesScript) + run_ctest_timeout(PropertyOverridesVar) +endblock() + +block() + set(TIMEOUT 4) + set(CASE_TEST_PREFIX_CODE "set(CTEST_TEST_TIMEOUT 2)") + set(CASE_CMAKELISTS_SUFFIX_CODE "set_property(TEST TestTimeout PROPERTY TIMEOUT)\n") + run_ctest_timeout(FlagOverridesVar --timeout 10000001) endblock() diff --git a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake index 9b7a6a997..f2df29019 100644 --- a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake +++ b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake @@ -24,6 +24,7 @@ run_multilint(CXX) if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") run_multilint(C-launch) run_multilint(CXX-launch) + run_multilint(genex) endif() function(run_skip_linting test_name) diff --git a/Tests/RunCMake/MultiLint/genex.cmake b/Tests/RunCMake/MultiLint/genex.cmake new file mode 100644 index 000000000..17f9248b0 --- /dev/null +++ b/Tests/RunCMake/MultiLint/genex.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) +set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$,${PSEUDO_IWYU},>") +set(CMAKE_CXX_CLANG_TIDY "$,${PSEUDO_TIDY} --error,>") +set(CMAKE_CXX_CPPLINT "$,${PSEUDO_CPPLINT} --error,>") +set(CMAKE_CXX_CPPCHECK "$,${PSEUDO_CPPCHECK} -bad,>") +add_executable(main main.cxx)