From 37869418c616f7e57c34b9287c4c8f3671df20de Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 8 Oct 2021 09:20:23 +0900 Subject: [PATCH] Imported Upstream version 3.18.6 --- Modules/CMakeDetermineCompilerId.cmake | 12 ++++++++---- Modules/FindPython/Support.cmake | 12 ++++++++++-- Source/CMakeVersion.cmake | 4 ++-- Source/cmGlobalNinjaGenerator.cxx | 14 +------------- Source/cmGlobalNinjaGenerator.h | 2 -- Source/cmStandardLexer.h | 2 +- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 44332a6..1feaf91 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -368,7 +368,14 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} endif() set(cuda_tools "CUDA ${CMAKE_VS_PLATFORM_TOOLSET_CUDA}") set(id_compile "CudaCompile") - set(id_ItemDefinitionGroup_entry "%(AdditionalOptions)-v") + if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) + set(cuda_target "64") + endif() + foreach(arch ${CMAKE_CUDA_ARCHITECTURES}) + string(REGEX MATCH "[0-9]+" arch_name "${arch}") + string(APPEND cuda_codegen "compute_${arch_name},sm_${arch_name};") + endforeach() + set(id_ItemDefinitionGroup_entry "${cuda_target}%(AdditionalOptions)-v${cuda_codegen}") set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]]) if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR) set(id_CudaToolkitCustomDir "${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc") @@ -378,9 +385,6 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} string(CONCAT id_Import_props [[]]) string(CONCAT id_Import_targets [[]]) endif() - if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) - set(id_ItemDefinitionGroup_entry "64%(AdditionalOptions)-v") - endif() if(CMAKE_CUDA_FLAGS MATCHES "(^| )-cudart +shared( |$)") set(id_Link_AdditionalDependencies "cudart.lib") else() diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index c8225c4..3732463 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -452,7 +452,11 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME) list (REMOVE_DUPLICATES _values) elseif (NAME STREQUAL "SOABI") # clean-up: remove prefix character and suffix - string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$") + set(_values "") + else() + string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + endif() endif() endif() endif() @@ -504,7 +508,11 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME) endforeach() if (_values) # clean-up: remove prefix character and suffix - string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$") + set(_values "") + else() + string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}") + endif() endif() endif() else() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7650cd6..0116ef5 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 18) -set(CMake_VERSION_PATCH 5) +set(CMake_VERSION_PATCH 6) #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 [==[1a059d91af CMake 3.18.5]==]) + set(git_info [==[0e1dba36c3 CMake 3.18.6]==]) # 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/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2c152ce..7f01b9c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -571,18 +571,9 @@ void cmGlobalNinjaGenerator::CleanMetaData() // Skip some ninja tools if they need 'build.ninja' but it is missing. bool const missingBuildManifest = expectBuildManifest && - (this->NinjaSupportsCleanDeadTool || - this->NinjaSupportsUnconditionalRecompactTool) && + this->NinjaSupportsUnconditionalRecompactTool && !cmSystemTools::FileExists("build.ninja"); - // The `cleandead` tool needs to know about all outputs in the build we just - // wrote out. Ninja-Multi doesn't have a single `build.ninja` we can use that - // is the union of all generated configurations, so we can't run it reliably - // in that case. - if (this->NinjaSupportsCleanDeadTool && expectBuildManifest && - !missingBuildManifest) { - run_ninja_tool({ "cleandead" }); - } // The `recompact` tool loads the manifest. As above, we don't have a single // `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the // future pending further investigation into how Ninja works upstream @@ -669,9 +660,6 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures() } } } - this->NinjaSupportsCleanDeadTool = !cmSystemTools::VersionCompare( - cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), - RequiredNinjaVersionForCleanDeadTool().c_str()); this->NinjaSupportsUnconditionalRecompactTool = !cmSystemTools::VersionCompare( cmSystemTools::OP_LESS, this->NinjaVersion.c_str(), diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 44e632f..8373de3 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -370,7 +370,6 @@ public: { return "1.10"; } - static std::string RequiredNinjaVersionForCleanDeadTool() { return "1.10"; } bool SupportsConsolePool() const; bool SupportsImplicitOuts() const; bool SupportsManifestRestat() const; @@ -533,7 +532,6 @@ private: bool NinjaSupportsDyndeps = false; bool NinjaSupportsRestatTool = false; bool NinjaSupportsUnconditionalRecompactTool = false; - bool NinjaSupportsCleanDeadTool = false; private: void InitOutputPathPrefix(); diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index e0b2116..b248b91 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -7,7 +7,7 @@ /* Needed for glibc < 2.12 */ # define _XOPEN_SOURCE 600 #endif -#if !defined(_WIN32) && !defined(__sun) +#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32) && !defined(__sun) /* POSIX APIs are needed */ # define _POSIX_C_SOURCE 200809L #endif -- 2.7.4