summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/3.22.rst13
-rw-r--r--Modules/CheckPIESupported.cmake11
-rw-r--r--Modules/FindPostgreSQL.cmake4
-rw-r--r--Source/cmLocalGenerator.cxx10
-rw-r--r--Source/cmakemain.cxx5
-rw-r--r--Tests/RunCMake/CMakePresets/ListConfigurePresetsWorkingDir-stdout.txt7
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake17
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/RunCMake.cmake2
10 files changed, 63 insertions, 17 deletions
diff --git a/Help/release/3.22.rst b/Help/release/3.22.rst
index efac925..00e93f6 100644
--- a/Help/release/3.22.rst
+++ b/Help/release/3.22.rst
@@ -151,9 +151,9 @@ Changes made since CMake 3.22.0 include the following.
3.22.1
------
-This version made no changes to documented features or interfaces.
-Some implementation updates were made to support ecosystem changes
-and/or fix regressions.
+* This version made no changes to documented features or interfaces.
+ Some implementation updates were made to support ecosystem changes
+ and/or fix regressions.
3.22.2
------
@@ -169,3 +169,10 @@ and/or fix regressions.
errors in existing projects. The fix has been reverted to restore
compatibility. The fix may be restored in a future version of CMake
via a policy.
+
+3.22.4
+------
+
+* This version made no changes to documented features or interfaces.
+ Some implementation updates were made to support ecosystem changes
+ and/or fix regressions.
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index 6424472..452348b 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -22,10 +22,13 @@ property for executables will be honored at link time.
Options are:
``OUTPUT_VARIABLE <output>``
- Set ``<output>`` variable with details about any error.
+ Set ``<output>`` variable with details about any error. If the check is
+ bypassed because it uses cached results from a previous call, the output
+ will be empty even if errors were present in the previous call.
``LANGUAGES <lang>...``
Check the linkers used for each of the specified languages.
+ If this option is not provided, the command checks all enabled languages.
``C``, ``CXX``, ``Fortran`` are supported.
@@ -43,9 +46,9 @@ Variables
For each language checked, two boolean cache variables are defined.
``CMAKE_<lang>_LINK_PIE_SUPPORTED``
- Set to ``YES`` if ``PIE`` is supported by the linker and ``NO`` otherwise.
+ Set to true if ``PIE`` is supported by the linker and false otherwise.
``CMAKE_<lang>_LINK_NO_PIE_SUPPORTED``
- Set to ``YES`` if ``NO_PIE`` is supported by the linker and ``NO`` otherwise.
+ Set to true if ``NO_PIE`` is supported by the linker and false otherwise.
Examples
^^^^^^^^
@@ -139,7 +142,7 @@ function (check_pie_supported)
# no support at link time. Set cache variables to NO
set(CMAKE_${lang}_LINK_PIE_SUPPORTED NO CACHE INTERNAL "PIE (${lang})")
set(CMAKE_${lang}_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (${lang})")
- string (APPEND outputs "PIE and NO_PIE are not supported by linker for ${lang}")
+ string (APPEND outputs "PIE and NO_PIE are not supported by linker for ${lang}\n")
endif()
endforeach()
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 25c5c09..2233aa0 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:
-# "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"
+# "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}
- "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")
+ "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/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2adb232..e39309c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2469,12 +2469,12 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
static const std::array<std::string, 4> langs = { { "C", "CXX", "OBJC",
"OBJCXX" } };
- bool haveAnyPch = false;
+ std::set<std::string> pchLangSet;
if (this->GetGlobalGenerator()->IsXcode()) {
for (const std::string& lang : langs) {
const std::string pchHeader = target->GetPchHeader(config, lang, "");
if (!pchHeader.empty()) {
- haveAnyPch = true;
+ pchLangSet.emplace(lang);
}
}
}
@@ -2519,9 +2519,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
const std::string pchHeader = target->GetPchHeader(config, lang, arch);
if (pchSource.empty() || pchHeader.empty()) {
- if (this->GetGlobalGenerator()->IsXcode() && haveAnyPch) {
+ if (this->GetGlobalGenerator()->IsXcode() && !pchLangSet.empty()) {
for (auto* sf : sources) {
- sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON");
+ if (pchLangSet.find(sf->GetLanguage()) == pchLangSet.end()) {
+ sf->SetProperty("SKIP_PRECOMPILE_HEADERS", "ON");
+ }
}
}
continue;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 0554c3e..76055b4 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -306,10 +306,11 @@ int do_cmake(int ac, char const* const* av)
parsedArgs.emplace_back("--find-package");
return true;
} },
- CommandArgument{ "--list-presets", CommandArgument::Values::Zero,
- [&](std::string const&) -> bool {
+ CommandArgument{ "--list-presets", CommandArgument::Values::ZeroOrOne,
+ [&](std::string const& value) -> bool {
workingMode = cmake::HELP_MODE;
parsedArgs.emplace_back("--list-presets");
+ parsedArgs.emplace_back(value);
return true;
} },
};
diff --git a/Tests/RunCMake/CMakePresets/ListConfigurePresetsWorkingDir-stdout.txt b/Tests/RunCMake/CMakePresets/ListConfigurePresetsWorkingDir-stdout.txt
new file mode 100644
index 0000000..97eedae
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/ListConfigurePresetsWorkingDir-stdout.txt
@@ -0,0 +1,7 @@
+^Not searching for unused variables given on the command line\.
+Available configure presets:
+
+ "zzzzzz" - Sleepy
+ "aaaaaaaa" - Screaming
+ "mmmmmm"
+ "no-generator"$
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index 449132a..5867efd 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -71,13 +71,18 @@ function(run_cmake_presets name)
set(_unused_cli)
endif()
+ set(_preset "--preset=${name}")
+ if(CMakePresets_NO_PRESET)
+ set(_preset)
+ endif()
+
set(RunCMake_TEST_COMMAND ${CMAKE_COMMAND}
${_source_args}
-DRunCMake_TEST=${name}
-DRunCMake_GENERATOR=${RunCMake_GENERATOR}
-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}
${_unused_cli}
- --preset=${name}
+ ${_preset}
${ARGN}
)
run_cmake(${name})
@@ -288,7 +293,10 @@ run_cmake_presets(ListPresets --list-presets)
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ListPresetsWorkingDir")
set(RunCMake_TEST_NO_CLEAN 1)
set(CMakePresets_NO_SOURCE_ARGS 1)
+set(CMakePresets_NO_PRESET 1)
run_cmake_presets(ListPresetsWorkingDir --list-presets)
+run_cmake_presets(ListConfigurePresetsWorkingDir --list-presets=configure)
+unset(CMakePresets_NO_PRESET)
unset(CMakePresets_NO_SOURCE_ARGS)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_BINARY_DIR)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake b/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake
new file mode 100644
index 0000000..dd582ac
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.16)
+project(PchIncludedAllLanguages C CXX)
+
+if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH)
+ add_definitions(-DHAVE_PCH_SUPPORT)
+endif()
+
+add_executable(main
+ main.cpp
+ empty.c
+ pch-included.cpp
+)
+
+target_precompile_headers(main PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/pch.h>)
+
+enable_testing()
+add_test(NAME main COMMAND main)
diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
index a7b3126..fd41e2f 100644
--- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
@@ -30,4 +30,5 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
endif()
run_test(PchReuseFromObjLib)
run_test(PchIncludedAllLanguages)
+run_test(PchIncludedOneLanguage)
run_test(PchLibObjLibExe)
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 9f692ee..26b4bae 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -165,7 +165,7 @@ 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]*warning: file type[^\n]*is based on missing file type"
- "|[^\n]*objc[^\n]*: Class AMSupportURL[^\n]* One of the two will be used. Which one is undefined."
+ "|[^\n]*objc[^\n]*: Class [^\n]* One of the two will be used. Which one is undefined."
"|[^\n]*is a member of multiple groups"
"|[^\n]*offset in archive not a multiple of 8"
"|[^\n]*from Time Machine by path"