diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:23 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:23 +0900 |
commit | 37869418c616f7e57c34b9287c4c8f3671df20de (patch) | |
tree | 3a4ff7b672076a3bf27a23fc5d0a031a68f86821 | |
parent | 2cae257828342914a3573b14d86b7abc5a77fe3d (diff) | |
download | cmake-37869418c616f7e57c34b9287c4c8f3671df20de.tar.gz cmake-37869418c616f7e57c34b9287c4c8f3671df20de.tar.bz2 cmake-37869418c616f7e57c34b9287c4c8f3671df20de.zip |
Imported Upstream version 3.18.6upstream/3.18.6
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 12 | ||||
-rw-r--r-- | Modules/FindPython/Support.cmake | 12 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 4 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmStandardLexer.h | 2 |
6 files changed, 22 insertions, 24 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 44332a66a..1feaf911c 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 "<CudaCompile><AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>") + if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) + set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>") + 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 "<CudaCompile>${cuda_target}<AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions><CodeGeneration>${cuda_codegen}</CodeGeneration></CudaCompile>") set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]]) if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR) set(id_CudaToolkitCustomDir "<CudaToolkitCustomDir>${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc</CudaToolkitCustomDir>") @@ -378,9 +385,6 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} string(CONCAT id_Import_props [[<Import Project="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.props" />]]) string(CONCAT id_Import_targets [[<Import Project="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.targets" />]]) endif() - if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) - set(id_ItemDefinitionGroup_entry "<CudaCompile><TargetMachinePlatform>64</TargetMachinePlatform><AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>") - endif() if(CMAKE_CUDA_FLAGS MATCHES "(^| )-cudart +shared( |$)") set(id_Link_AdditionalDependencies "<AdditionalDependencies>cudart.lib</AdditionalDependencies>") else() diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index c8225c4c5..3732463d0 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 7650cd6fd..0116ef593 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 2c152ce64..7f01b9c44 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 44e632fe5..8373de3b9 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 e0b21165e..b248b919a 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 |