diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst index 0c7845ce4..7e08b483c 100644 --- a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst +++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst @@ -21,6 +21,8 @@ support per-configuration specification. For example, the code: selects for the target ``foo`` the program database debug information format for the Debug configuration. +This property is initialized from the value of the +:variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable, if it is set. If this property is not set, CMake selects a debug information format using the default value ``$<$:ProgramDatabase>``, if supported by the compiler, and otherwise diff --git a/Help/release/3.27.rst b/Help/release/3.27.rst index 7bcfc9a48..72386ee4d 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.3, 3.27.4, 3.27.5 +---------------------- * These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index f2e4804d0..1f82bb52a 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -1365,7 +1365,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_TIMER_DEPENDENCIES chrono) set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) - else() + elseif(Boost_VERSION_STRING VERSION_LESS 1.83.0) set(_Boost_CONTRACT_DEPENDENCIES thread chrono) set(_Boost_COROUTINE_DEPENDENCIES context) set(_Boost_FIBER_DEPENDENCIES context) @@ -1380,7 +1380,21 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) set(_Boost_TIMER_DEPENDENCIES chrono) set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic) set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) - if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.83.0 AND NOT Boost_NO_WARN_NEW_VERSIONS) + else() + set(_Boost_CONTRACT_DEPENDENCIES thread chrono) + set(_Boost_COROUTINE_DEPENDENCIES context) + set(_Boost_FIBER_DEPENDENCIES context) + set(_Boost_IOSTREAMS_DEPENDENCIES regex) + set(_Boost_JSON_DEPENDENCIES container) + set(_Boost_LOG_DEPENDENCIES log_setup filesystem thread regex chrono atomic) + set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l) + set(_Boost_MPI_DEPENDENCIES serialization) + set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization) + set(_Boost_NUMPY_DEPENDENCIES python${component_python_version}) + set(_Boost_THREAD_DEPENDENCIES chrono atomic) + set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) + if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.84.0 AND NOT Boost_NO_WARN_NEW_VERSIONS) message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets") endif() endif() @@ -1655,7 +1669,7 @@ else() # _Boost_COMPONENT_HEADERS. See the instructions at the top of # _Boost_COMPONENT_DEPENDENCIES. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79" + "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79" "1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74" "1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69" "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index 2c85029ed..81481a7ba 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -374,6 +374,7 @@ function(FortranCInterface_VERIFY) "-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}" "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}" "-DFortranCInterface_BINARY_DIR=${FortranCInterface_BINARY_DIR}" + "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}" ${_FortranCInterface_OSX_ARCH} ${_FortranCInterface_EXE_LINKER_FLAGS} OUTPUT_VARIABLE _output) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 196067839..1d949902d 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 4) +set(CMake_VERSION_PATCH 5) #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 [==[c3977582b7 CMake 3.27.4]==]) + set(git_info [==[7d3b4868d0 CMake 3.27.5]==]) # 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/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 7d4b0a847..c04f23a1f 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -309,6 +309,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( // specify target ::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str()); + // follow redirects + ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); + // CURLAUTH_BASIC is default, and here we allow additional methods, // including more secure ones ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 98d5eff07..02627464c 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -96,7 +96,7 @@ else() set(CMake_HAVE_CXX_FILESYSTEM FALSE) endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l|sparc") +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|aarch64)$") cm_check_cxx_feature(atomic_builtin) if(NOT CMake_HAVE_CXX_ATOMIC_BUILTIN) set(cm_check_cxx_feature_LINK_LIBRARIES atomic) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ebbb88f6a..480456584 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -533,11 +533,14 @@ cmComputeLinkInformation::GetObjectLibrariesLinked() const bool cmComputeLinkInformation::Compute() { - // Skip targets that do not link. + // Skip targets that do not link or have link-like information consumers may + // need (namely modules). if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE || this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || this->Target->GetType() == cmStateEnums::MODULE_LIBRARY || - this->Target->GetType() == cmStateEnums::STATIC_LIBRARY)) { + this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || + this->Target->HaveCxx20ModuleSources() || + this->Target->HaveFortranSources())) { return false; } diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx index 80e13578a..b50718c7a 100644 --- a/Source/cmDyndepCollation.cxx +++ b/Source/cmDyndepCollation.cxx @@ -106,10 +106,11 @@ Json::Value CollationInformationCxxModules( auto lookup = sf_map.find(file); if (lookup == sf_map.end()) { gt->Makefile->IssueMessage( - MessageType::INTERNAL_ERROR, - cmStrCat("Target \"", tgt->GetName(), "\" has source file \"", + MessageType::FATAL_ERROR, + cmStrCat("Target \"", tgt->GetName(), "\" has source file\n ", file, - R"(" which is not in any of its "FILE_SET BASE_DIRS".)")); + "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not " + "scheduled for compilation.")); continue; } diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 1919b014e..782d6c8b7 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -23,6 +23,7 @@ class cmGeneratorTarget; SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \ SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \ SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \ + SELECT(F, EvaluatingAutoMocMacroNames, AUTOMOC_MACRO_NAMES) \ SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS) \ SELECT(F, EvaluatingSources, SOURCES) \ SELECT(F, EvaluatingCompileFeatures, COMPILE_FEATURES) \ diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357d0a66a..7d1fcf3e5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8873,6 +8873,15 @@ bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const }); } +bool cmGeneratorTarget::HaveFortranSources() const +{ + auto sources = cmGeneratorTarget::GetAllConfigSources(); + return std::any_of(sources.begin(), sources.end(), + [](AllConfigSource const& sf) -> bool { + return sf.Source->GetLanguage() == "Fortran"_s; + }); +} + bool cmGeneratorTarget::HaveCxx20ModuleSources() const { auto const& fs_names = this->Target->GetAllFileSetNames(); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 78945c3fa..dca69fd00 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -1247,6 +1247,7 @@ public: cmGeneratorTarget const* t2) const; }; + bool HaveFortranSources() const; bool HaveFortranSources(std::string const& config) const; // C++20 module support queries. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b3699ae73..949d74956 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2540,6 +2540,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) break; } + std::string config; + if (!this->Configurations.empty()) { + config = this->Configurations[si.Configs[0]]; + } + auto const* fs = + this->GeneratorTarget->GetFileSetForSource(config, si.Source); if (tool) { // Compute set of configurations to exclude, if any. std::vector const& include_configs = si.Configs; @@ -2604,6 +2610,13 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) if (si.Kind == cmGeneratorTarget::SourceKindObjectSource || si.Kind == cmGeneratorTarget::SourceKindUnityBatched) { this->OutputSourceSpecificFlags(e2, si.Source); + } else if (fs && fs->GetType() == "CXX_MODULES"_s) { + this->GeneratorTarget->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Target \"", this->GeneratorTarget->GetName(), + "\" has source file\n ", si.Source->GetFullPath(), + "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not " + "scheduled for compilation.")); } if (si.Source->GetPropertyAsBool("SKIP_PRECOMPILE_HEADERS")) { e2.Element("PrecompiledHeader", "NotUsing"); @@ -2613,6 +2626,13 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) } this->FinishWritingSource(e2, toolSettings); + } else if (fs && fs->GetType() == "CXX_MODULES"_s) { + this->GeneratorTarget->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Target \"", this->GeneratorTarget->GetName(), + "\" has source file\n ", si.Source->GetFullPath(), + "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not " + "scheduled for compilation.")); } } @@ -3855,7 +3875,10 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions( void cmVisualStudio10TargetGenerator::WriteCudaLinkOptions( Elem& e1, std::string const& configName) { - if (this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) { + // We need to write link options for OBJECT libraries so that + // we override the default device link behavior ( enabled ) when + // building object libraries with ptx/optix-ir/etc + if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) { return; } diff --git a/Tests/CudaOnly/Fatbin/CMakeLists.txt b/Tests/CudaOnly/Fatbin/CMakeLists.txt index db0dc227e..99744044c 100644 --- a/Tests/CudaOnly/Fatbin/CMakeLists.txt +++ b/Tests/CudaOnly/Fatbin/CMakeLists.txt @@ -10,6 +10,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelB.cu ${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelC.cu) set_property(TARGET CudaFATBIN PROPERTY CUDA_FATBIN_COMPILATION ON) +set_property(TARGET CudaFATBIN PROPERTY CUDA_SEPARABLE_COMPILATION ON) # Will use `cuModuleLoadFatBinary` to load the fatbinaries add_executable(CudaOnlyFatbin main.cu) diff --git a/Tests/CudaOnly/OptixIR/CMakeLists.txt b/Tests/CudaOnly/OptixIR/CMakeLists.txt index afeabdade..f408d4032 100644 --- a/Tests/CudaOnly/OptixIR/CMakeLists.txt +++ b/Tests/CudaOnly/OptixIR/CMakeLists.txt @@ -13,6 +13,7 @@ if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.7.0") set_property(TARGET CudaOptix PROPERTY CUDA_OPTIX_COMPILATION ON) endif() +set_property(TARGET CudaOptix PROPERTY CUDA_SEPARABLE_COMPILATION ON) set_property(TARGET CudaOptix PROPERTY CUDA_ARCHITECTURES native) add_executable(CudaOnlyOptixIR main.cu) diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt index aa7f406fc..7e8f384ea 100644 --- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt @@ -15,6 +15,11 @@ CMake Error in CMakeLists.txt: been enabled | The "nocxx" target contains C\+\+ module sources which are not supported by the generator +| Target "nocxx" has source file + + .*/Tests/RunCMake/CXXModules/sources/module.cxx + + in a "FILE_SET TYPE CXX_MODULES" but it is not scheduled for compilation. ) )* CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-result.txt b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt new file mode 100644 index 000000000..52f407220 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt @@ -0,0 +1,16 @@ +CMake Warning \(dev\) at NotCompiledSourceModules.cmake:5 \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +Call Stack \(most recent call first\): + CMakeLists.txt:6 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +(CMake Error in CMakeLists.txt: + Target "not-cxx-source" has source file + + .*/Tests/RunCMake/CXXModules/sources/not-compiled.txt + + in a "FILE_SET TYPE CXX_MODULES" but it is not scheduled for compilation. + +)+ +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake b/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake new file mode 100644 index 000000000..0bab63525 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake @@ -0,0 +1,13 @@ +enable_language(CXX) +set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") + +add_library(not-cxx-source) +target_sources(not-cxx-source + PRIVATE + sources/cxx-anchor.cxx + PUBLIC + FILE_SET fs TYPE CXX_MODULES FILES + sources/not-compiled.txt) +target_compile_features(not-cxx-source + PRIVATE + cxx_std_20) diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index d324ec940..89c198f17 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -71,8 +71,9 @@ foreach (fileset_type IN LISTS fileset_types) endforeach () run_cmake("FileSet${fileset_type}InterfaceImported") - # Test the error message when a non-C++ source file is found in the source + # Test the error messages when a non-C++ source file is found in the source # list. + run_cmake("NotCompiledSource${fileset_type}") run_cmake("NotCXXSource${fileset_type}") endforeach () diff --git a/Tests/RunCMake/CXXModules/sources/not-compiled.txt b/Tests/RunCMake/CXXModules/sources/not-compiled.txt new file mode 100644 index 000000000..e69de29bb