Skip to content

Commit

Permalink
Merge branch 'release-3.27.7' into zh_CN
Browse files Browse the repository at this point in the history
  • Loading branch information
gwankyun committed Oct 7, 2023
2 parents 5f3a2cf + 9532e1c commit 93453a4
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Help/manual/ctest.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,8 @@ CTest测试步骤
* :module:`CTest`\ 变量:\ ``CTEST_TEST_LOAD``

``TimeOut``
如果未由\ :prop_test:`TIMEOUT`\ 属性指定,则为每个测试的默认超时。
如果未由\ :prop_test:`TIMEOUT`\ 属性或者\ :option:`--timeout <ctest --timeout>`\
标识指定,则为每个测试的默认超时。

* `CTest Script`_\ 变量::variable:`CTEST_TEST_TIMEOUT`
* :module:`CTest`\ 变量:\ ``DART_TESTING_TIMEOUT``
Expand Down
42 changes: 37 additions & 5 deletions Help/policy/CMP0124.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Help/release/3.27.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion Modules/Compiler/Clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Modules/FindPostgreSQL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/CMakeVersion.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
11 changes: 6 additions & 5 deletions Source/CTest/cmCTestRunTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions Source/cmCommonTargetGenerator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
+
Expand Down
6 changes: 6 additions & 0 deletions Tests/RunCMake/CTestTimeout/PropertyOverridesVar-stdout.txt
Original file line number Diff line number Diff line change
@@ -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
9 changes: 8 additions & 1 deletion Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 1 addition & 0 deletions Tests/RunCMake/MultiLint/RunCMakeTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions Tests/RunCMake/MultiLint/genex.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enable_language(CXX)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$<IF:$<BOOL:FALSE>,${PSEUDO_IWYU},>")
set(CMAKE_CXX_CLANG_TIDY "$<IF:$<BOOL:FALSE>,${PSEUDO_TIDY} --error,>")
set(CMAKE_CXX_CPPLINT "$<IF:$<BOOL:FALSE>,${PSEUDO_CPPLINT} --error,>")
set(CMAKE_CXX_CPPCHECK "$<IF:$<BOOL:FALSE>,${PSEUDO_CPPCHECK} -bad,>")
add_executable(main main.cxx)

0 comments on commit 93453a4

Please sign in to comment.