diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:19 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:19 +0900 |
commit | 50689498d1ad916f12dc24a034014fe5e4cb9904 (patch) | |
tree | f75c0a847b9dfddf8649a8c8d206b18203d4021e | |
parent | 26b982ef204f01d7ed60688e523d55757b4d8574 (diff) | |
download | cmake-50689498d1ad916f12dc24a034014fe5e4cb9904.tar.gz cmake-50689498d1ad916f12dc24a034014fe5e4cb9904.tar.bz2 cmake-50689498d1ad916f12dc24a034014fe5e4cb9904.zip |
Imported Upstream version 3.18.4upstream/3.18.4
-rw-r--r-- | Modules/CMakeFindBinUtils.cmake | 3 | ||||
-rw-r--r-- | Modules/CMakeOBJCInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeOBJCXXInformation.cmake | 2 | ||||
-rw-r--r-- | Modules/FindCUDA/select_compute_arch.cmake | 16 | ||||
-rw-r--r-- | Modules/FindJNI.cmake | 2 | ||||
-rw-r--r-- | Modules/FindPython/Support.cmake | 2 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 4 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 9 | ||||
-rw-r--r-- | Templates/MSBuild/FlagTables/v142_CL.json | 14 | ||||
-rw-r--r-- | Tests/ObjCXX/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ObjCXX/cxx-as-objcxx/main.cpp | 6 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png | 0 |
15 files changed, 67 insertions, 16 deletions
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index b2004f109..73d57f0e0 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -72,10 +72,11 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xClang") find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm llvm-nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) set(_CMAKE_ADDITIONAL_LINKER_NAMES "lld-link") + set(_CMAKE_ADDITIONAL_AR_NAMES "llvm-lib") endif() find_program(CMAKE_LINKER NAMES ${_CMAKE_ADDITIONAL_LINKER_NAMES} link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) - find_program(CMAKE_AR NAMES lib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) + find_program(CMAKE_AR NAMES ${_CMAKE_ADDITIONAL_AR_NAMES} lib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_MT NAMES mt HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) list(APPEND _CMAKE_TOOL_VARS LINKER MT) diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake index b3da82d59..d53019175 100644 --- a/Modules/CMakeOBJCInformation.cmake +++ b/Modules/CMakeOBJCInformation.cmake @@ -170,7 +170,7 @@ endif() # compile an Objective-C file into an object file if(NOT CMAKE_OBJC_COMPILE_OBJECT) set(CMAKE_OBJC_COMPILE_OBJECT - "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x objective-c -o <OBJECT> -c <SOURCE>") + "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> -x objective-c <FLAGS> -o <OBJECT> -c <SOURCE>") endif() if(NOT CMAKE_OBJC_LINK_EXECUTABLE) diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake index 4be97620e..7a3b9d7d0 100644 --- a/Modules/CMakeOBJCXXInformation.cmake +++ b/Modules/CMakeOBJCXXInformation.cmake @@ -263,7 +263,7 @@ endif() # compile an Objective-C++ file into an object file if(NOT CMAKE_OBJCXX_COMPILE_OBJECT) set(CMAKE_OBJCXX_COMPILE_OBJECT - "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") + "<CMAKE_OBJCXX_COMPILER> <DEFINES> <INCLUDES> -x objective-c++ <FLAGS> -o <OBJECT> -c <SOURCE>") endif() if(NOT CMAKE_OBJCXX_LINK_EXECUTABLE) diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index c11725d99..93512882d 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -7,7 +7,7 @@ # ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX # NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing Ampere # NUM: Any number. Only those pairs are currently accepted by NVCC though: -# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 8.0 +# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 8.0 8.6 # Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} # Additionally, sets ${out_variable}_readable to the resulting numeric list # Example: @@ -82,16 +82,26 @@ if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5") if(CUDA_VERSION VERSION_LESS "11.0") - set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0") endif() endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Ampere") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0" "8.0+PTX") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0") list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.0") + if(CUDA_VERSION VERSION_LESS "11.1") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0+PTX") + set(CUDA_LIMIT_GPU_ARCHITECTURE "8.6") + endif() +endif() + +if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.6" "8.6+PTX") + list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.6") + if(CUDA_VERSION VERSION_LESS "12.0") set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0") endif() diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index eff815ddc..bbca95286 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -60,7 +60,7 @@ macro(java_append_library_directories _var) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") set(_java_libarch "i386") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") - set(_java_libarch "arm64") + set(_java_libarch "arm64" "aarch64") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha") set(_java_libarch "alpha") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 42bb9fe64..c8225c4c5 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -612,7 +612,7 @@ function (_PYTHON_GET_VERSION) if (NOT config) # pyconfig.h can be a wrapper to a platform specific pyconfig.h # In this case, try to identify ABI from include directory - if (_${_PYTHON_PREFIX}_INCLUDE_DIR MATCHES "python${version_major}\.${version_minor}+([dmu]*)") + if (_${_PYTHON_PREFIX}_INCLUDE_DIR MATCHES "python${version_major}\\.${version_minor}+([dmu]*)") set (abi "${CMAKE_MATCH_1}") else() set (abi "") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8cd7669c5..25b35210a 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 3) +set(CMake_VERSION_PATCH 4) #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 [==[177fc02073 CMake 3.18.3]==]) + set(git_info [==[3cc3d42aba CMake 3.18.4]==]) # 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/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a8e424d60..f58c6fd71 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -4927,6 +4927,7 @@ std::string cmVisualStudio10TargetGenerator::GetCSharpSourceLink( // for this file exists, otherwise we check if the path relative to current // source- or binary-dir is used within the link and return that std::string link; + std::string sourceGroupedFile; std::string const& fullFileName = source->GetFullPath(); std::string const& srcDir = this->Makefile->GetCurrentSourceDirectory(); std::string const& binDir = this->Makefile->GetCurrentBinaryDirectory(); @@ -4936,8 +4937,14 @@ std::string cmVisualStudio10TargetGenerator::GetCSharpSourceLink( cmSourceGroup* sourceGroup = this->Makefile->FindSourceGroup(fullFileName, sourceGroups); if (sourceGroup && !sourceGroup->GetFullName().empty()) { - link = sourceGroup->GetFullName() + "/" + + sourceGroupedFile = sourceGroup->GetFullName() + "/" + cmsys::SystemTools::GetFilenameName(fullFileName); + cmsys::SystemTools::ConvertToUnixSlashes(sourceGroupedFile); + } + + if (!sourceGroupedFile.empty() && + cmHasSuffix(fullFileName, sourceGroupedFile)) { + link = sourceGroupedFile; } else if (cmHasPrefix(fullFileName, srcDir)) { link = fullFileName.substr(srcDir.length() + 1); } else if (cmHasPrefix(fullFileName, binDir)) { diff --git a/Templates/MSBuild/FlagTables/v142_CL.json b/Templates/MSBuild/FlagTables/v142_CL.json index 95b9d14f6..7c2d291f9 100644 --- a/Templates/MSBuild/FlagTables/v142_CL.json +++ b/Templates/MSBuild/FlagTables/v142_CL.json @@ -455,6 +455,20 @@ "flags": [] }, { + "name": "LanguageStandard_C", + "switch": "std:c11", + "comment": "ISO C11 Standard", + "value": "stdc11", + "flags": [] + }, + { + "name": "LanguageStandard_C", + "switch": "std:c17", + "comment": "ISO C17 (2018) Standard", + "value": "stdc17", + "flags": [] + }, + { "name": "PrecompiledHeader", "switch": "Yc", "comment": "Create", diff --git a/Tests/ObjCXX/CMakeLists.txt b/Tests/ObjCXX/CMakeLists.txt index a2a907a67..cf03771c8 100644 --- a/Tests/ObjCXX/CMakeLists.txt +++ b/Tests/ObjCXX/CMakeLists.txt @@ -2,3 +2,4 @@ ADD_TEST_MACRO(ObjCXX.ObjC++ ObjC++) ADD_TEST_MACRO(ObjCXX.simple-build-test simple-build-test) ADD_TEST_MACRO(ObjCXX.cxx-file-extension-test cxx-file-extension-test) ADD_TEST_MACRO(ObjCXX.objcxx-file-extension-test objcxx-file-extension-test) +ADD_TEST_MACRO(ObjCXX.cxx-as-objcxx cxx-as-objcxx) diff --git a/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt b/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt new file mode 100644 index 000000000..23f689195 --- /dev/null +++ b/Tests/ObjCXX/cxx-as-objcxx/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.18) +project(cxx-as-objcxx LANGUAGES OBJCXX) + +add_executable(cxx-as-objcxx main.cpp) +set_source_files_properties(main.cpp PROPERTIES LANGUAGE OBJCXX) diff --git a/Tests/ObjCXX/cxx-as-objcxx/main.cpp b/Tests/ObjCXX/cxx-as-objcxx/main.cpp new file mode 100644 index 000000000..701c567d0 --- /dev/null +++ b/Tests/ObjCXX/cxx-as-objcxx/main.cpp @@ -0,0 +1,6 @@ +#import <Foundation/Foundation.h> + +int main(int argc, char* argv[]) +{ + return 0; +} diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake index 3b5c70f55..80d76e40c 100644 --- a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake @@ -9,12 +9,13 @@ file(STRINGS "${csProjFile}" lines) include(${RunCMake_TEST_SOURCE_DIR}/VsCsharpSourceGroupHelpers.cmake) set(SOURCE_GROUPS_TO_FIND - "CSharpSourceGroup" - "CSharpSourceGroup/nested" - "Images" + "CSharpSourceGroup\\\\foo\\.cs" + "CSharpSourceGroup\\\\nested\\\\baz\\.cs" + "CSharpSourceGroup\\\\images\\\\empty\\.bmp" + "VsCsharpSourceGroup\\.png" ) -foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND}) +foreach(GROUP_NAME IN LISTS SOURCE_GROUPS_TO_FIND) find_source_group("${lines}" ${GROUP_NAME}) if(NOT ${SOURCE_GROUP_FOUND}) return() diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake index 024993c3f..510d71294 100644 --- a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake @@ -9,8 +9,14 @@ set(SRC_FILES set(IMAGE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/Images/empty.bmp ) +# We explicitly don't set a source group for a source in the root level +# because of https://gitlab.kitware.com/cmake/cmake/-/issues/21221 +set(RESOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/VsCsharpSourceGroup.png +) + -add_library(VsCsharpSourceGroup SHARED ${SRC_FILES} ${IMAGE_FILES}) +add_library(VsCsharpSourceGroup SHARED ${SRC_FILES} ${IMAGE_FILES} ${RESOURCE_FILES}) source_group("CSharpSourceGroup" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs) source_group("CSharpSourceGroup/nested" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs) source_group("Images" FILES ${IMAGE_FILES}) diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.png |