summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml107
-rw-r--r--.gitlab/ci/gitlab_ci.cmake2
-rw-r--r--CMakeLists.txt40
-rw-r--r--Help/command/target_precompile_headers.rst2
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst12
-rw-r--r--Modules/Compiler/ARMClang.cmake67
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx21
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h4
-rw-r--r--Source/cmLocalGenerator.cxx13
-rw-r--r--Source/cmVSSetupHelper.cxx14
-rw-r--r--Source/cmVSSetupHelper.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx10
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake33
-rw-r--r--Utilities/Release/linux/x86_64/Dockerfile2
-rwxr-xr-xUtilities/Sphinx/create_identifiers.py12
-rw-r--r--Utilities/cmThirdPartyChecks.cmake16
-rw-r--r--Utilities/cmexpat/ConfigureChecks.cmake11
-rw-r--r--Utilities/cmexpat/expat_config.h.cmake6
-rw-r--r--Utilities/cmlibarchive/build/cmake/config.h.in20
-rw-r--r--Utilities/cmliblzma/config.h.in18
23 files changed, 315 insertions, 104 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cf7cb26..3447964 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,13 @@
when: always
- when: never
+.release_linux: &release_linux
+ image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
+
+ variables:
+ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+ LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
+
.fedora31: &fedora31
image: "kitware/cmake:ci-fedora31-x86_64-2020-06-01"
@@ -75,25 +82,31 @@
.macos: &macos
variables:
+ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
+ # TODO: Factor this out so that each job selects the Xcode version to
+ # use so that different versions can be tested in a single pipeline.
+ DEVELOPER_DIR: "/Applications/Xcode-11.5.app/Contents/Developer"
+
+.macos_build: &macos_build
+ extends: .macos
+
+ variables:
# Note that shell runners only support runners with a single
# concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
# change between the build and test stages which CMake doesn't support.
# Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
- # TODO: Factor this out so that each job selects the Xcode version to
- # use so that different versions can be tested in a single pipeline.
- DEVELOPER_DIR: "/Applications/Xcode-11.5.app/Contents/Developer"
.macos_ninja: &macos_ninja
- extends: .macos
+ extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.macos_makefiles: &macos_makefiles
- extends: .macos
+ extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_makefiles
@@ -102,6 +115,12 @@
.windows: &windows
variables:
+ GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci ext\\$CI_CONCURRENT_ID"
+
+.windows_build: &windows_build
+ extends: .windows
+
+ variables:
# Note that shell runners only support runners with a single
# concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
# change between the build and test stages which CMake doesn't support.
@@ -110,7 +129,7 @@
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci"
.windows_ninja: &windows_ninja
- extends: .windows
+ extends: .windows_build
variables:
# Debug and RelWithDebinfo build types use the `/Zi` which results in
@@ -126,7 +145,7 @@
CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x64"
- VCVARSVERSION: "14.25"
+ VCVARSVERSION: "14.26"
.windows_vs2019_x64: &windows_vs2019_x64
extends: .windows
@@ -135,7 +154,7 @@
CMAKE_CONFIGURATION: windows_vs2019_x64
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_GENERATOR_PLATFORM: "x64"
- CMAKE_GENERATOR_TOOLSET: "v142,version=14.25"
+ CMAKE_GENERATOR_TOOLSET: "v142,version=14.26"
.linux_builder_tags: &linux_builder_tags
tags:
@@ -156,8 +175,15 @@
- macos
- shell
- xcode-11.5
- - nonconcurrent # Use runners without concurrency for fixed GIT_CLONE_PATH.
- # TODO: Use "concurrent" and "nonconcurrent" on individual jobs.
+ - nonconcurrent
+
+.macos_builder_ext_tags: &macos_builder_ext_tags
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - macos
+ - shell
+ - xcode-11.5
+ - concurrent
.windows_builder_tags: &windows_builder_tags
tags:
@@ -166,8 +192,16 @@
- shell
- vs2019
- msvc-19.25
- - nonconcurrent # Use runners without concurrency for fixed GIT_CLONE_PATH.
- # TODO: Use "concurrent" and "nonconcurrent" on individual jobs.
+ - nonconcurrent
+
+.windows_builder_ext_tags: &windows_builder_ext_tags
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - windows
+ - shell
+ - vs2019
+ - msvc-19.25
+ - concurrent
.before_script_unix: &before_script_unix
- .gitlab/ci/cmake.sh
@@ -199,6 +233,38 @@
interruptible: true
+.cmake_build_release_linux: &cmake_build_release_linux
+ stage: build
+
+ script:
+ # Bootstrap.
+ - mkdir build/
+ - cp -v Utilities/Release/linux/x86_64/cache.txt build/CMakeCache.txt
+ # Make sccache available.
+ - .gitlab/ci/sccache.sh
+ - export PATH=$PWD/.gitlab:$PATH
+ # Append sccache settings to the cache.
+ - echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
+ - echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
+ # CI settings.
+ - echo "CMake_TEST_INSTALL:BOOL=OFF" >> build/CMakeCache.txt
+ - echo "CMAKE_INSTALL_PREFIX:PATH=$PWD/build/install" >> build/CMakeCache.txt
+ - echo "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY:BOOL=ON" >> build/CMakeCache.txt
+ # Bootstrap
+ - cd build/
+ - "$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake"
+ # FIXME: When CTest can drive an external CMake for the build as well,
+ # use the scripts here.
+ - "$LAUNCHER make -j$(nproc)"
+ # NOTE: This regex matches that used in the release build.
+ - "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|CMakeServerLib\\.|RunCMake\\.ctest_memcheck)'"
+ # Make a package.
+ - bin/cpack -G TGZ
+ - bin/cpack -G STGZ
+ - sccache --show-stats
+
+ interruptible: true
+
.cmake_build_windows: &cmake_build_windows
stage: build
@@ -279,6 +345,13 @@
- build/DartConfiguation.tcl
- build/CTestCustom.cmake
+.cmake_release_artifacts: &cmake_release_artifacts
+ artifacts:
+ expire_in: 5d
+ paths:
+ # Any packages made.
+ - build/cmake-*-Linux-x86_64.*
+
.cmake_test_artifacts: &cmake_test_artifacts
artifacts:
expire_in: 1d
@@ -353,6 +426,14 @@ build:fedora31-sphinx:
- *linux_builder_tags_qt
rules: *rules_settings
+build:centos6-release:
+ <<:
+ - *release_linux
+ - *cmake_build_release_linux
+ - *cmake_release_artifacts
+ - *linux_builder_tags
+ rules: *manual_rules_settings
+
build:fedora31-ninja:
<<:
- *fedora31_ninja
@@ -465,7 +546,7 @@ test:windows-vs2019-x64:
<<:
- *windows_vs2019_x64
- *cmake_test_windows_external
- - *windows_builder_tags
+ - *windows_builder_ext_tags
rules: *rules_settings
dependencies:
- test:windows-vs2019-x64-ninja
diff --git a/.gitlab/ci/gitlab_ci.cmake b/.gitlab/ci/gitlab_ci.cmake
index e9c9f80..698d5ea 100644
--- a/.gitlab/ci/gitlab_ci.cmake
+++ b/.gitlab/ci/gitlab_ci.cmake
@@ -49,7 +49,7 @@ endif ()
set(ctest_track "Experimental")
if (NOT "$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
set(ctest_track "merge-requests")
-elseif ("$ENV{CI_PROJECT_PATH}" STREQUAL "cmb/smtk")
+elseif ("$ENV{CI_PROJECT_PATH}" STREQUAL "cmake/cmake")
if ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "master")
set(ctest_track "master")
elseif ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "release")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15dbcd3..f62c666 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -356,6 +356,21 @@ macro (CMAKE_BUILD_UTILITIES)
if(CMake_NO_CXX_STANDARD)
set(KWSYS_CXX_STANDARD "")
endif()
+ if(WIN32)
+ # FIXME: Teach KWSys to hard-code these checks on Windows.
+ set(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC_COMPILED 0)
+ set(KWSYS_C_HAS_PTRDIFF_T_COMPILED 1)
+ set(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H_COMPILED 1)
+ set(KWSYS_CXX_HAS_RLIMIT64_COMPILED 0)
+ set(KWSYS_CXX_HAS_SETENV_COMPILED 0)
+ set(KWSYS_CXX_HAS_UNSETENV_COMPILED 0)
+ set(KWSYS_CXX_HAS_UTIMENSAT_COMPILED 0)
+ set(KWSYS_CXX_HAS_UTIMES_COMPILED 0)
+ set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0)
+ set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0)
+ set(KWSYS_STL_HAS_WSTRING_COMPILED 1)
+ set(KWSYS_SYS_HAS_IFADDRS_H 0)
+ endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
@@ -438,6 +453,13 @@ macro (CMAKE_BUILD_UTILITIES)
else()
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
set(CMAKE_ZLIB_LIBRARIES cmzlib)
+ set(WITHOUT_ZLIB_DLL "")
+ set(WITHOUT_ZLIB_DLL_WITH_LIB cmzlib)
+ set(ZLIB_DLL "")
+ set(ZLIB_DLL_WITH_LIB cmzlib)
+ set(ZLIB_WINAPI "")
+ set(ZLIB_WINAPI_COMPILED 0)
+ set(ZLIB_WINAPI_WITH_LIB cmzlib)
add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
endif()
@@ -514,6 +536,11 @@ macro (CMAKE_BUILD_UTILITIES)
set(BZIP2_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
set(BZIP2_LIBRARIES cmbzip2)
+ set(BZIP2_NEED_PREFIX "")
+ set(USE_BZIP2_DLL "")
+ set(USE_BZIP2_DLL_WITH_LIB cmbzip2)
+ set(USE_BZIP2_STATIC "")
+ set(USE_BZIP2_STATIC_WITH_LIB cmbzip2)
add_subdirectory(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
endif()
@@ -699,10 +726,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
- # no clue why we are testing for this here
- include(CheckSymbolExists)
- CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
- CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ # Checks for cmSystemTools.
+ if(WIN32)
+ set(HAVE_UNSETENV 0)
+ set(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE 1)
+ else()
+ include(CheckSymbolExists)
+ CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
+ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ endif()
endif()
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 0d4f45a..d4280b1 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -93,7 +93,7 @@ Reusing Precompile Headers
^^^^^^^^^^^^^^^^^^^^^^^^^^
The command also supports a second signature which can be used to specify that
-one target re-uses a precompiled header file artefact from another target
+one target re-uses a precompiled header file artifact from another target
instead of generating its own:
.. code-block:: cmake
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index 3aa296d..c9ece22 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -13,9 +13,9 @@ included in the "all" target of its ancestor directories unless the
With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
will be brought up to date as part of doing a ``make install`` or its
-equivalent for the CMake generator being used. If a target has
-``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
-target has undefined behavior. Note that such a target can still safely
-be listed in an :command:`install(TARGETS)` command as long as the install
-components the target belongs to are not part of the set of components
-that anything tries to install.
+equivalent for the CMake generator being used.
+
+If a target has ``EXCLUDE_FROM_ALL`` set to true, it may still be listed
+in an :command:`install(TARGETS)` command, but the user is responsible for
+ensuring that the target's build artifacts are not missing or outdated when
+an install is performed.
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index f0fdcd5..d412399 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -46,6 +46,32 @@ function(__armclang_check_processor processor list out_var)
endif()
endfunction()
+# get compiler supported arch list
+function(__armclang_set_arch_list lang out_var)
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --target=${CMAKE_${lang}_COMPILER_TARGET} -march=list
+ OUTPUT_VARIABLE arch_list
+ ERROR_VARIABLE arch_list)
+ string(REGEX MATCHALL "-march=([^ \n]*)" arch_list "${arch_list}")
+ string(REGEX REPLACE "-march=" "" arch_list "${arch_list}")
+ set(${out_var} "${arch_list}" PARENT_SCOPE)
+endfunction()
+
+# get linker supported cpu list
+function(__armlink_set_cpu_list lang out_var)
+ if(__CMAKE_ARMClang_USING_armlink)
+ set(__linker_wrapper_flags "")
+ else()
+ set(__linker_wrapper_flags --target=${CMAKE_${lang}_COMPILER_TARGET} -XLinker)
+ endif()
+
+ execute_process(COMMAND "${CMAKE_LINKER}" ${__linker_wrapper_flags} --cpu=list
+ OUTPUT_VARIABLE cpu_list
+ ERROR_VARIABLE cpu_list)
+ string(REGEX MATCHALL "--cpu=([^ \n]*)" cpu_list "${cpu_list}")
+ string(REGEX REPLACE "--cpu=" "" cpu_list "${cpu_list}")
+ set(${out_var} "${cpu_list}" PARENT_SCOPE)
+endfunction()
+
macro(__compiler_armclang lang)
if(NOT CMAKE_${lang}_COMPILER_TARGET)
set(CMAKE_${lang}_COMPILER_TARGET arm-arm-none-eabi)
@@ -53,19 +79,40 @@ macro(__compiler_armclang lang)
if(NOT CMAKE_${lang}_COMPILER_PROCESSOR_LIST)
__armclang_set_processor_list(${lang} CMAKE_${lang}_COMPILER_PROCESSOR_LIST)
endif()
- if(NOT CMAKE_SYSTEM_PROCESSOR)
- message(FATAL_ERROR " CMAKE_SYSTEM_PROCESSOR must be set for ARMClang\n"
- " Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n")
+ if(NOT CMAKE_${lang}_COMPILER_ARCH_LIST)
+ __armclang_set_arch_list(${lang} CMAKE_${lang}_COMPILER_ARCH_LIST)
+ endif()
+ if(NOT CMAKE_SYSTEM_PROCESSOR AND NOT CMAKE_SYSTEM_ARCH)
+ message(FATAL_ERROR " CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
+ " Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n"
+ " Supported Architecture: ${CMAKE_${lang}_COMPILER_ARCH_LIST}")
else()
- __armclang_check_processor("${CMAKE_SYSTEM_PROCESSOR}" "${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}" _CMAKE_${lang}_CHECK_RESULT)
- if(NOT _CMAKE_${lang}_CHECK_RESULT)
- message(FATAL_ERROR " System processor '${CMAKE_SYSTEM_PROCESSOR}' not supported by ARMClang ${lang} compiler\n"
- " Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n")
+ __armclang_check_processor("${CMAKE_SYSTEM_ARCH}" "${CMAKE_${lang}_COMPILER_ARCH_LIST}" _CMAKE_${lang}_CHECK_ARCH_RESULT)
+ if( _CMAKE_${lang}_CHECK_ARCH_RESULT)
+ string(APPEND CMAKE_${lang}_FLAGS_INIT "-march=${CMAKE_SYSTEM_ARCH}")
+ set(__march_flag_set TRUE)
+ endif()
+ __armclang_check_processor("${CMAKE_SYSTEM_PROCESSOR}" "${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}" _CMAKE_${lang}_CHECK_PROCESSOR_RESULT)
+ if(_CMAKE_${lang}_CHECK_PROCESSOR_RESULT)
+ string(APPEND CMAKE_${lang}_FLAGS_INIT "-mcpu=${CMAKE_SYSTEM_PROCESSOR}")
+ set(__mcpu_flag_set TRUE)
endif()
- unset(_CMAKE_${lang}_CHECK_RESULT)
+ if(NOT __march_flag_set AND NOT __mcpu_flag_set)
+ message(FATAL_ERROR "Atleast one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
+ "Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n"
+ " Supported Architecture: ${CMAKE_${lang}_COMPILER_ARCH_LIST}")
+ endif()
+ unset(_CMAKE_${lang}_CHECK_PROCESSOR_RESULT)
+ unset(_CMAKE_${lang}_CHECK_ARCH_RESULT)
+ endif()
+
+ #check if CMAKE_SYSTEM_PROCESSOR belongs to supported cpu list for armlink
+ __armlink_set_cpu_list( ${lang} CMAKE_LINKER_CPU_LIST)
+ list(TRANSFORM CMAKE_LINKER_CPU_LIST TOLOWER)
+ __armclang_check_processor("${CMAKE_SYSTEM_PROCESSOR}" "${CMAKE_LINKER_CPU_LIST}" _CMAKE_CHECK_LINK_CPU_RESULT)
+ if(_CMAKE_CHECK_LINK_CPU_RESULT)
+ string(APPEND CMAKE_${lang}_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}")
endif()
- string(APPEND CMAKE_${lang}_FLAGS_INIT "-mcpu=${CMAKE_SYSTEM_PROCESSOR}")
- string(APPEND CMAKE_${lang}_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}")
if(__CMAKE_ARMClang_USING_armlink)
set(__CMAKE_ARMClang_USING_armlink_WRAPPER "")
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 22d8032..1b6bb00 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -8,7 +8,9 @@ set(CMAKE_CXX_EXTENSIONS FALSE)
include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
-if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+if(WIN32)
+ set(HAVE_ELF_H 0)
+elseif(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
CHECK_INCLUDE_FILES("stdint.h;elf_abi.h" HAVE_ELF_H)
else()
CHECK_INCLUDE_FILE("elf.h" HAVE_ELF_H)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 72d71e6..562d083 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 17)
-set(CMake_VERSION_PATCH 20200603)
+set(CMake_VERSION_PATCH 20200605)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index f659ff3..b8c18b4 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -121,6 +121,8 @@ public:
bool IsIPOSupported() const override { return true; }
+ virtual bool IsStdOutEncodingSupported() const { return false; }
+
static std::string GetInstalledNsightTegraVersion();
/** Return the first two components of CMAKE_SYSTEM_VERSION. */
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 13ae32a..605dc8b 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -366,6 +366,12 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance(
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
}
+bool cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion(
+ unsigned long long& vsInstanceVersion) const
+{
+ return vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion);
+}
+
bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
const std::string& version) const
{
@@ -387,6 +393,21 @@ bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
return false;
}
+bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
+{
+ // Supported from Visual Studio 16.7 Preview 3.
+ if (this->Version > cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return true;
+ }
+ if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS16) {
+ return false;
+ }
+ unsigned long long const vsInstanceVersion16_7_P2 = 4503631666610212;
+ unsigned long long vsInstanceVersion;
+ return (this->GetVSInstanceVersion(vsInstanceVersion) &&
+ vsInstanceVersion > vsInstanceVersion16_7_P2);
+}
+
std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
{
const char* version = this->GetPlatformToolsetVersion();
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index abb6095..cbd3ba7 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -29,9 +29,13 @@ public:
bool GetVSInstance(std::string& dir) const;
+ bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
+
bool IsDefaultToolset(const std::string& version) const override;
std::string GetAuxiliaryToolset() const override;
+ bool IsStdOutEncodingSupported() const override;
+
protected:
cmGlobalVisualStudioVersionedGenerator(
VSVersion version, cmake* cm, const std::string& name,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f299202..fba9cdb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1986,6 +1986,19 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
}
} else if (lang == "CUDA") {
target->AddCUDAArchitectureFlags(flags);
+
+ std::string const& compiler =
+ this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID");
+
+ if (compiler == "Clang") {
+ bool separable = target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION");
+
+ if (separable) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "CUDA_SEPARABLE_COMPILATION isn't supported on Clang.");
+ }
+ }
}
// Add MSVC runtime library flags. This is activated by the presence
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index dd9f058..9626599 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -258,6 +258,20 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
return isInstalled;
}
+bool cmVSSetupAPIHelper::GetVSInstanceVersion(
+ unsigned long long& vsInstanceVersion)
+{
+ vsInstanceVersion = 0;
+ bool isInstalled = this->EnumerateAndChooseVSInstance();
+
+ if (isInstalled) {
+ vsInstanceVersion =
+ static_cast<unsigned long long>(chosenInstanceInfo.ullVersion);
+ }
+
+ return isInstalled;
+}
+
bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion)
{
vsToolsetVersion.clear();
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index a2fd3d5..a926eee 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -106,6 +106,7 @@ public:
bool IsVSInstalled();
bool GetVSInstanceInfo(std::string& vsInstallLocation);
+ bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion);
bool GetVCToolsetVersion(std::string& vsToolsetVersion);
bool IsWin10SDKInstalled();
bool IsWin81SDKInstalled();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8cb933b..97c4c85 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalVisualStudio10Generator.h"
+#include "cmGlobalVisualStudioVersionedGenerator.h"
#include "cmLinkLineDeviceComputer.h"
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
@@ -4951,10 +4952,9 @@ std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath(
return path;
}
-void cmVisualStudio10TargetGenerator::WriteStdOutEncodingUtf8(Elem& /* e1 */)
+void cmVisualStudio10TargetGenerator::WriteStdOutEncodingUtf8(Elem& e1)
{
- // FIXME: As of VS 16.6.0, this breaks custom commands with symbolic outputs.
- // See https://gitlab.kitware.com/cmake/cmake/-/issues/20769 for details.
- // Disable it for now.
- // e1.Element("StdOutEncoding", "UTF-8");
+ if (this->GlobalGenerator->IsStdOutEncodingSupported()) {
+ e1.Element("StdOutEncoding", "UTF-8");
+ }
}
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
index 4d0c02f..0126080 100644
--- a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
@@ -21,26 +21,29 @@ target_link_options (LinkOptions_private PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEV
if (CMake_TEST_CUDA)
enable_language(CUDA)
- add_executable(LinkOptions_CMP0105_UNSET LinkOptionsDevice.cu)
- set_property(TARGET LinkOptions_CMP0105_UNSET PROPERTY CUDA_SEPARABLE_COMPILATION ON)
- target_link_options(LinkOptions_CMP0105_UNSET PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+ # Separable compilation is only supported on NVCC.
+ if(NOT CMake_TEST_CUDA STREQUAL "Clang")
+ add_executable(LinkOptions_CMP0105_UNSET LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_UNSET PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_UNSET PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
- cmake_policy(SET CMP0105 OLD)
+ cmake_policy(SET CMP0105 OLD)
- add_executable(LinkOptions_CMP0105_OLD LinkOptionsDevice.cu)
- set_property(TARGET LinkOptions_CMP0105_OLD PROPERTY CUDA_SEPARABLE_COMPILATION ON)
- target_link_options(LinkOptions_CMP0105_OLD PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+ add_executable(LinkOptions_CMP0105_OLD LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_OLD PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_OLD PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
- cmake_policy(SET CMP0105 NEW)
+ cmake_policy(SET CMP0105 NEW)
- add_executable(LinkOptions_CMP0105_NEW LinkOptionsDevice.cu)
- set_property(TARGET LinkOptions_CMP0105_NEW PROPERTY CUDA_SEPARABLE_COMPILATION ON)
- target_link_options(LinkOptions_CMP0105_NEW PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+ add_executable(LinkOptions_CMP0105_NEW LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_NEW PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_NEW PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
- add_executable(LinkOptions_device LinkOptionsDevice.cu)
- set_property(TARGET LinkOptions_device PROPERTY CUDA_SEPARABLE_COMPILATION ON)
- target_link_options(LinkOptions_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
- $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+ add_executable(LinkOptions_device LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_device PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+ endif()
add_executable(LinkOptions_no_device LinkOptionsDevice.cu)
target_link_options(LinkOptions_no_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
diff --git a/Utilities/Release/linux/x86_64/Dockerfile b/Utilities/Release/linux/x86_64/Dockerfile
index 41391d2..972913e 100644
--- a/Utilities/Release/linux/x86_64/Dockerfile
+++ b/Utilities/Release/linux/x86_64/Dockerfile
@@ -5,6 +5,7 @@
# Build using the CMake source directory as the build context.
# The resulting image will have an '/out' directory containing the package.
+# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image.
ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-x86_64-deps-2020-04-02
ARG FROM_IMAGE_DIGEST=@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157
ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
@@ -20,7 +21,6 @@ RUN : \
&& cp ../cmake/Utilities/Release/linux/x86_64/cache.txt CMakeCache.txt \
&& source /opt/rh/devtoolset-6/enable \
&& source /opt/rh/rh-python36/enable \
- && export LANG=en_US.UTF-8 \
&& set -x \
&& ../cmake/bootstrap --parallel=$(nproc) --docdir=doc/cmake \
&& nice make -j $(nproc) \
diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py
index b5cd914..e35f127 100755
--- a/Utilities/Sphinx/create_identifiers.py
+++ b/Utilities/Sphinx/create_identifiers.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-import sys, os
+import sys
if len(sys.argv) != 2:
sys.exit(-1)
name = sys.argv[1] + "/CMake.qhp"
-f = open(name)
+f = open(name, "rb")
if not f:
sys.exit(-1)
-lines = f.read().splitlines()
+lines = f.read().decode("utf-8").splitlines()
if not lines:
sys.exit(-1)
@@ -38,7 +38,7 @@ for line in lines:
for domain_object_string, domain_object_type in mapping:
if "<keyword name=\"" + domain_object_string + "\"" in line:
- if not "id=\"" in line and not "#index-" in line:
+ if "id=\"" not in line and "#index-" not in line:
prefix = "<keyword name=\"" + domain_object_string + "\" "
part1, part2 = line.split(prefix)
head, tail = part2.split("#" + domain_object_type + ":")
@@ -46,5 +46,5 @@ for line in lines:
line = part1 + prefix + "id=\"" + domain_object_type + "/" + domain_object + "\" " + part2
newlines.append(line + "\n")
-f = open(name, "w")
-f.writelines(newlines)
+f = open(name, "wb")
+f.writelines(map(lambda line: line.encode("utf-8"), newlines))
diff --git a/Utilities/cmThirdPartyChecks.cmake b/Utilities/cmThirdPartyChecks.cmake
index 0b57940..4ccfdfc 100644
--- a/Utilities/cmThirdPartyChecks.cmake
+++ b/Utilities/cmThirdPartyChecks.cmake
@@ -19,9 +19,10 @@ set(HAVE_STRFTIME 1)
set(HAVE_STRING_H 1)
set(HAVE_STRRCHR 1)
set(HAVE_WCHAR_H 1)
-set(SIZEOF_INT 4)
-set(SIZEOF_LONG_LONG 8)
-set(SIZEOF_SHORT 2)
+
+# Used by TEST_BIG_ENDIAN.
+set(CMAKE_SIZEOF_UNSIGNED_SHORT 2)
+set(HAVE_CMAKE_SIZEOF_UNSIGNED_SHORT 1)
if(WIN32)
# Results for builds targeting Windows platforms.
@@ -151,7 +152,7 @@ if(WIN32)
set(HAVE_READLINK 0)
set(HAVE_READLINKAT 0)
set(HAVE_READPASSPHRASE 0)
- set(HAVE_READPASSPHRASE 0)
+ set(HAVE_READPASSPHRASE_H 0)
set(HAVE_REGEX_H 0)
set(HAVE_RSA_H 0)
set(HAVE_SELECT 0)
@@ -260,6 +261,13 @@ if(WIN32)
# curl and expat: stdlib.h, stdarg.h, string.h, float.h
set(STDC_HEADERS 1)
+ # UNIX device APIs do not exist on Windows.
+ set(MAJOR_IN_MKDEV 0)
+ set(MAJOR_IN_SYSMACROS 0)
+
+ # FreeBSD libmd does not exist on Windows.
+ set(LIBMD_FOUND 0)
+
# libarchive looks for external hash implementations.
set(ARCHIVE_CRYPTO_MD5_LIBC 0)
set(ARCHIVE_CRYPTO_MD5_LIBMD 0)
diff --git a/Utilities/cmexpat/ConfigureChecks.cmake b/Utilities/cmexpat/ConfigureChecks.cmake
index d85e48c..4da252c 100644
--- a/Utilities/cmexpat/ConfigureChecks.cmake
+++ b/Utilities/cmexpat/ConfigureChecks.cmake
@@ -44,14 +44,6 @@ else(WORDS_BIGENDIAN)
set(BYTEORDER 1234)
endif(WORDS_BIGENDIAN)
-if(HAVE_SYS_TYPES_H)
- check_symbol_exists("off_t" "sys/types.h" OFF_T)
- check_symbol_exists("size_t" "sys/types.h" SIZE_T)
-else(HAVE_SYS_TYPES_H)
- set(OFF_T "long")
- set(SIZE_T "unsigned")
-endif(HAVE_SYS_TYPES_H)
-
check_c_source_compiles("
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
@@ -61,6 +53,3 @@ check_c_source_compiles("
return 0;
}"
HAVE_SYSCALL_GETRANDOM)
-
-check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
-check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
diff --git a/Utilities/cmexpat/expat_config.h.cmake b/Utilities/cmexpat/expat_config.h.cmake
index 795b607..e91861e 100644
--- a/Utilities/cmexpat/expat_config.h.cmake
+++ b/Utilities/cmexpat/expat_config.h.cmake
@@ -86,9 +86,3 @@
#ifdef _MSC_VER
# define __func__ __FUNCTION__
#endif
-
-/* Define to `long' if <sys/types.h> does not define. */
-#cmakedefine off_t @OFF_T@
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#cmakedefine size_t @SIZE_T@
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index e889781..f38601f 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -1118,34 +1118,34 @@
#include <cm3p/kwiml/int.h>
#ifndef KWIML_INT_HAVE_INT64_T
-# define int64_t KWIML_INT_int64_t
+typedef KWIML_INT_int64_t int64_t;
#endif
#ifndef KWIML_INT_HAVE_INT32_T
-# define int32_t KWIML_INT_int32_t
+typedef KWIML_INT_int32_t int32_t;
#endif
#ifndef KWIML_INT_HAVE_INT16_T
-# define int16_t KWIML_INT_int16_t
+typedef KWIML_INT_int16_t int16_t;
#endif
#ifndef KWIML_INT_HAVE_INT8_T
-# define int8_t KWIML_INT_int8_t
+typedef KWIML_INT_int8_t int8_t;
#endif
#ifndef KWIML_INT_HAVE_INTPTR_T
-# define intptr_t KWIML_INT_intptr_t
+typedef KWIML_INT_intptr_t intptr_t;
#endif
#ifndef KWIML_INT_HAVE_UINT64_T
-# define uint64_t KWIML_INT_uint64_t
+typedef KWIML_INT_uint64_t uint64_t;
#endif
#ifndef KWIML_INT_HAVE_UINT32_T
-# define uint32_t KWIML_INT_uint32_t
+typedef KWIML_INT_uint32_t uint32_t;
#endif
#ifndef KWIML_INT_HAVE_UINT16_T
-# define uint16_t KWIML_INT_uint16_t
+typedef KWIML_INT_uint16_t uint16_t;
#endif
#ifndef KWIML_INT_HAVE_UINT8_T
-# define uint8_t KWIML_INT_uint8_t
+typedef KWIML_INT_uint8_t uint8_t;
#endif
#ifndef KWIML_INT_HAVE_UINTPTR_T
-# define uintptr_t KWIML_INT_uintptr_t
+typedef KWIML_INT_uintptr_t uintptr_t;
#endif
/* Define to 1 if you have the <stdint.h> header file. */
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 8e4dc93..20916ca 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -6,31 +6,31 @@
#include <cm3p/kwiml/int.h>
#ifndef KWIML_INT_HAVE_INT64_T
-# define int64_t KWIML_INT_int64_t
+typedef KWIML_INT_int64_t int64_t;
#endif
#ifndef KWIML_INT_HAVE_INT32_T
-# define int32_t KWIML_INT_int32_t
+typedef KWIML_INT_int32_t int32_t;
#endif
#ifndef KWIML_INT_HAVE_INT16_T
-# define int16_t KWIML_INT_int16_t
+typedef KWIML_INT_int16_t int16_t;
#endif
#ifndef KWIML_INT_HAVE_INT8_T
-# define int8_t KWIML_INT_int8_t
+typedef KWIML_INT_int8_t int8_t;
#endif
#ifndef KWIML_INT_HAVE_UINT64_T
-# define uint64_t KWIML_INT_uint64_t
+typedef KWIML_INT_uint64_t uint64_t;
#endif
#ifndef KWIML_INT_HAVE_UINT32_T
-# define uint32_t KWIML_INT_uint32_t
+typedef KWIML_INT_uint32_t uint32_t;
#endif
#ifndef KWIML_INT_HAVE_UINT16_T
-# define uint16_t KWIML_INT_uint16_t
+typedef KWIML_INT_uint16_t uint16_t;
#endif
#ifndef KWIML_INT_HAVE_UINT8_T
-# define uint8_t KWIML_INT_uint8_t
+typedef KWIML_INT_uint8_t uint8_t;
#endif
#ifndef KWIML_INT_HAVE_UINTPTR_T
-# define uintptr_t KWIML_INT_uintptr_t
+typedef KWIML_INT_uintptr_t uintptr_t;
#endif
#cmakedefine WORDS_BIGENDIAN 1