Update upstream source from tag 'upstream/3.29.4'

Update to upstream version '3.29.4'
with Debian dir 592b76685f
ci/unstable
Timo Röhling 7 months ago
commit 02943a985e

@ -219,3 +219,10 @@ Changes made since CMake 3.28.0 include the following.
* This version made no changes to documented features or interfaces. * This version made no changes to documented features or interfaces.
Some implementation updates were made to C++ modules support. Some implementation updates were made to C++ modules support.
3.28.6
------
* This version made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes
and/or fix regressions.

@ -212,8 +212,8 @@ Changes made since CMake 3.29.0 include the following.
:prop_tgt:`LINKER_TYPE` target property now work with compilers :prop_tgt:`LINKER_TYPE` target property now work with compilers
for the ``Swift`` language. for the ``Swift`` language.
3.29.2, 3.29.3 3.29.2, 3.29.3, 3.29.4
-------------- ----------------------
* These versions made no changes to documented features or interfaces. * These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes Some implementation updates were made to support ecosystem changes

@ -19,7 +19,7 @@ Known version numbers are::
1900 = VS 14.0 (v140 toolset) 1900 = VS 14.0 (v140 toolset)
1910-1919 = VS 15.0 (v141 toolset) 1910-1919 = VS 15.0 (v141 toolset)
1920-1929 = VS 16.0 (v142 toolset) 1920-1929 = VS 16.0 (v142 toolset)
1930-1939 = VS 17.0 (v143 toolset) 1930-1949 = VS 17.0 (v143 toolset)
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` and See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` and
:variable:`MSVC_TOOLSET_VERSION` variable. :variable:`MSVC_TOOLSET_VERSION` variable.

@ -567,7 +567,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>") set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>")
endif() endif()
set(id_ItemDefinitionGroup_entry "<CudaCompile>${cuda_target}<AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>") set(id_ItemDefinitionGroup_entry "<CudaCompile>${cuda_target}<AdditionalOptions>%(AdditionalOptions)-v -allow-unsupported-compiler</AdditionalOptions></CudaCompile>")
set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]]) set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]])
if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR) if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR)
# check for legacy cuda custom toolkit folder structure # check for legacy cuda custom toolkit folder structure

@ -2224,7 +2224,16 @@ function(_ep_get_configuration_subdir_genex suffix_var)
set(suffix "") set(suffix "")
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig) if(_isMultiConfig)
set(suffix "/$<CONFIG>") if(CMAKE_GENERATOR STREQUAL "Xcode")
# The Xcode generator does not support per-config sources,
# so use the underlying build system's placeholder instead.
# FIXME(#23652): We have no test for the use case requiring
# CMAKE_CFG_INTDIR for XCODE_EMIT_EFFECTIVE_PLATFORM_NAME,
# but $<CONFIG> does not work.
set(suffix "/${CMAKE_CFG_INTDIR}")
else()
set(suffix "/$<CONFIG>")
endif()
endif() endif()
set(${suffix_var} "${suffix}" PARENT_SCOPE) set(${suffix_var} "${suffix}" PARENT_SCOPE)
endfunction() endfunction()

@ -1,7 +1,7 @@
# CMake version number components. # CMake version number components.
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 29) set(CMake_VERSION_MINOR 29)
set(CMake_VERSION_PATCH 3) set(CMake_VERSION_PATCH 4)
#set(CMake_VERSION_RC 0) #set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0) set(CMake_VERSION_IS_DIRTY 0)
@ -21,7 +21,7 @@ endif()
if(NOT CMake_VERSION_NO_GIT) if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info. # If this source was exported by 'git archive', use its commit info.
set(git_info [==[b39fb31bf4 CMake 3.29.3]==]) set(git_info [==[efaa9efece CMake 3.29.4]==])
# Otherwise, try to identify the current development source version. # 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]* " 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]* "

@ -434,3 +434,17 @@ std::string CxxModuleMapContent(CxxModuleMapFormat format,
assert(false); assert(false);
return {}; return {};
} }
CxxModuleMapMode CxxModuleMapOpenMode(CxxModuleMapFormat format)
{
switch (format) {
case CxxModuleMapFormat::Gcc:
return CxxModuleMapMode::Binary;
case CxxModuleMapFormat::Clang:
case CxxModuleMapFormat::Msvc:
return CxxModuleMapMode::Default;
}
assert(false);
return CxxModuleMapMode::Default;
}

@ -83,6 +83,14 @@ struct CxxModuleUsage
LookupMethod method); LookupMethod method);
}; };
enum class CxxModuleMapMode
{
Text,
Binary,
Default = Text,
};
// Return the extension to use for a given modulemap format. // Return the extension to use for a given modulemap format.
cm::static_string_view CxxModuleMapExtension( cm::static_string_view CxxModuleMapExtension(
cm::optional<CxxModuleMapFormat> format); cm::optional<CxxModuleMapFormat> format);
@ -101,3 +109,6 @@ std::string CxxModuleMapContent(CxxModuleMapFormat format,
CxxModuleLocations const& loc, CxxModuleLocations const& loc,
cmScanDepInfo const& obj, cmScanDepInfo const& obj,
CxxModuleUsage const& usages); CxxModuleUsage const& usages);
// Return the open mode required for the modmap file format.
CxxModuleMapMode CxxModuleMapOpenMode(CxxModuleMapFormat format);

@ -2730,6 +2730,7 @@ cmGlobalGenerator::SplitFrameworkPath(const std::string& path,
} }
static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt, static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt,
std::string const& targetNameAsWritten,
std::string const& reason) std::string const& reason)
{ {
MessageType messageType = MessageType::AUTHOR_WARNING; MessageType messageType = MessageType::AUTHOR_WARNING;
@ -2750,8 +2751,8 @@ static bool RaiseCMP0037Message(cmake* cm, cmTarget* tgt,
break; break;
} }
if (issueMessage) { if (issueMessage) {
e << "The target name \"" << tgt->GetName() << "\" is reserved " << reason e << "The target name \"" << targetNameAsWritten << "\" is reserved "
<< "."; << reason << ".";
if (messageType == MessageType::AUTHOR_WARNING) { if (messageType == MessageType::AUTHOR_WARNING) {
e << " It may result in undefined behavior."; e << " It may result in undefined behavior.";
} }
@ -2770,7 +2771,8 @@ bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
if (!tgt) { if (!tgt) {
return true; return true;
} }
return RaiseCMP0037Message(this->GetCMakeInstance(), tgt, reason); return RaiseCMP0037Message(this->GetCMakeInstance(), tgt, targetName,
reason);
} }
void cmGlobalGenerator::CreateDefaultGlobalTargets( void cmGlobalGenerator::CreateDefaultGlobalTargets(

@ -2806,7 +2806,10 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
// `cmNinjaTargetGenerator::WriteObjectBuildStatements` and // `cmNinjaTargetGenerator::WriteObjectBuildStatements` and
// `cmNinjaTargetGenerator::ExportObjectCompileCommand` to generate the // `cmNinjaTargetGenerator::ExportObjectCompileCommand` to generate the
// corresponding file path. // corresponding file path.
cmGeneratedFileStream mmf(cmStrCat(object.PrimaryOutput, ".modmap")); cmGeneratedFileStream mmf;
mmf.Open(cmStrCat(object.PrimaryOutput, ".modmap"), false,
CxxModuleMapOpenMode(*modmap_fmt) ==
CxxModuleMapMode::Binary);
mmf.SetCopyIfDifferent(true); mmf.SetCopyIfDifferent(true);
mmf << mm; mmf << mm;
} }

@ -476,6 +476,22 @@ static int testFile()
# define _WIN32_WINNT_VISTA 0x0600 # define _WIN32_WINNT_VISTA 0x0600
# endif # endif
static bool consoleIsConhost()
{
wchar_t consoleClassNameBuf[64];
int const consoleClassNameLen = GetClassNameW(
GetConsoleWindow(), &consoleClassNameBuf[0], sizeof(consoleClassNameBuf));
// Windows Console Host: ConsoleWindowClass
// Windows Terminal / ConPTY: PseudoConsoleWindow (undocumented)
return (consoleClassNameLen > 0 &&
wcscmp(consoleClassNameBuf, L"ConsoleWindowClass") == 0);
}
static bool charIsNUL(wchar_t c)
{
return c == 0;
}
static int testConsole() static int testConsole()
{ {
int didFail = 1; int didFail = 1;
@ -691,7 +707,15 @@ static int testConsole()
throw std::runtime_error("ReadConsoleOutputCharacter failed!"); throw std::runtime_error("ReadConsoleOutputCharacter failed!");
} }
std::wstring wideTestString = kwsys::Encoding::ToWide(encodedTestString); std::wstring wideTestString = kwsys::Encoding::ToWide(encodedTestString);
std::replace(wideTestString.begin(), wideTestString.end(), '\0', ' '); if (consoleIsConhost()) {
// Windows Console Host converts NUL bytes to spaces.
std::replace(wideTestString.begin(), wideTestString.end(), '\0', ' ');
} else {
// Windows Terminal / ConPTY removes NUL bytes.
wideTestString.erase(std::remove_if(wideTestString.begin(),
wideTestString.end(), charIsNUL),
wideTestString.end());
}
std::wstring wideInputTestString = std::wstring wideInputTestString =
kwsys::Encoding::ToWide(encodedInputTestString); kwsys::Encoding::ToWide(encodedInputTestString);
if (memcmp(outputBuffer, wideTestString.c_str(), if (memcmp(outputBuffer, wideTestString.c_str(),

@ -45,6 +45,10 @@ run_cmake(WARN-cond)
run_cmake(WARN-cond-test) run_cmake(WARN-cond-test)
run_cmake(WARN-cond-package) run_cmake(WARN-cond-package)
run_cmake(alias-test-NEW)
run_cmake(alias-test-OLD)
run_cmake(alias-test-WARN)
if(RunCMake_GENERATOR MATCHES "Make|Ninja") if(RunCMake_GENERATOR MATCHES "Make|Ninja")
run_cmake(NEW-cond-package_source) run_cmake(NEW-cond-package_source)
run_cmake(OLD-cond-package_source) run_cmake(OLD-cond-package_source)

@ -0,0 +1,5 @@
^CMake Error at alias-test-common\.cmake:[0-9]+ \(add_library\):
The target name "test" is reserved when CTest testing is enabled\.
Call Stack \(most recent call first\):
alias-test-NEW\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)$

@ -0,0 +1,2 @@
cmake_policy(SET CMP0037 NEW)
include(alias-test-common.cmake)

@ -0,0 +1,10 @@
^CMake Deprecation Warning at alias-test-OLD\.cmake:[0-9]+ \(cmake_policy\):
The OLD behavior for policy CMP0037 will be removed from a future version
of CMake\.
The cmake-policies\(7\) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances\. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD\.
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$

@ -0,0 +1,2 @@
cmake_policy(SET CMP0037 OLD)
include(alias-test-common.cmake)

@ -0,0 +1,11 @@
^CMake Warning \(dev\) at alias-test-common\.cmake:[0-9]+ \(add_library\):
Policy CMP0037 is not set: Target names should not be reserved and should
match a validity pattern\. Run "cmake --help-policy CMP0037" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
The target name "test" is reserved when CTest testing is enabled\. It may
result in undefined behavior\.
Call Stack \(most recent call first\):
alias-test-WARN\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)

@ -0,0 +1,2 @@
# leave CMP0037 unset
include(alias-test-common.cmake)

@ -0,0 +1,3 @@
enable_testing()
add_library(iface INTERFACE)
add_library(test ALIAS iface)

@ -513,6 +513,10 @@ set(execute_process_ARGS
if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT CMake_TEST_EXTERNAL_CMAKE)
list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>) list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>)
endif() endif()
if(WIN32)
add_executable(testStartupInfo testStartupInfo.c)
list(APPEND execute_process_ARGS -DTEST_STARTUPINFO_EXE=$<TARGET_FILE:testStartupInfo>)
endif()
add_RunCMake_test(execute_process) add_RunCMake_test(execute_process)
add_RunCMake_test(export) add_RunCMake_test(export)
if(CMake_TEST_MSYSTEM_PREFIX) if(CMake_TEST_MSYSTEM_PREFIX)

@ -53,3 +53,7 @@ if(WIN32 OR CYGWIN)
set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(WindowsNoExtension-build ${CMAKE_COMMAND} --build . --config Debug --target RunScript) run_cmake_command(WindowsNoExtension-build ${CMAKE_COMMAND} --build . --config Debug --target RunScript)
endif() endif()
if(TEST_STARTUPINFO_EXE)
run_cmake_script(StartupInfo -DTEST_STARTUPINFO_EXE=${TEST_STARTUPINFO_EXE})
endif()

@ -0,0 +1 @@
execute_process(COMMAND "${TEST_STARTUPINFO_EXE}" COMMAND_ERROR_IS_FATAL ANY)

@ -0,0 +1,25 @@
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1928
# pragma warning(disable : 5105) /* macro expansion warning in windows.h */
#endif
#include <windows.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
STARTUPINFOW si;
memset(&si, 0, sizeof(si));
GetStartupInfoW(&si);
if (si.cbReserved2 != 0 || si.lpReserved2 != NULL) {
fprintf(stderr, "si.cbReserved2: %u\n", si.cbReserved2);
fprintf(stderr, "si.lpReserved2: %p\n", si.lpReserved2);
return 1;
}
return 0;
}

@ -1083,8 +1083,15 @@ int uv_spawn(uv_loop_t* loop,
startup.lpTitle = NULL; startup.lpTitle = NULL;
startup.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; startup.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
#if 1
/* cmake does not need libuv's support for passing file descriptors >= 3
to the MSVC C run-time in the child. Avoid using reserved members. */
startup.cbReserved2 = 0;
startup.lpReserved2 = NULL;
#else
startup.cbReserved2 = uv__stdio_size(process->child_stdio_buffer); startup.cbReserved2 = uv__stdio_size(process->child_stdio_buffer);
startup.lpReserved2 = (BYTE*) process->child_stdio_buffer; startup.lpReserved2 = (BYTE*) process->child_stdio_buffer;
#endif
startup.hStdInput = uv__stdio_handle(process->child_stdio_buffer, 0); startup.hStdInput = uv__stdio_handle(process->child_stdio_buffer, 0);
startup.hStdOutput = uv__stdio_handle(process->child_stdio_buffer, 1); startup.hStdOutput = uv__stdio_handle(process->child_stdio_buffer, 1);

Loading…
Cancel
Save