summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:56 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:56 +0900
commit7bf65aec6825377cb70a176d71f21116f1d977df (patch)
tree8f702de450f62c070f2e85157ffc8eaf25d47764
parent0a793b9589edea1ea74c0bfcbfef46c1a37f7291 (diff)
downloadcmake-7bf65aec6825377cb70a176d71f21116f1d977df.tar.gz
cmake-7bf65aec6825377cb70a176d71f21116f1d977df.tar.bz2
cmake-7bf65aec6825377cb70a176d71f21116f1d977df.zip
Imported Upstream version 3.20.6upstream/3.20.6
-rw-r--r--Help/release/3.20.rst4
-rw-r--r--Modules/CMakeCCompilerId.c.in5
-rw-r--r--Modules/Compiler/IntelLLVM-C.cmake10
-rw-r--r--Modules/Compiler/IntelLLVM-CXX.cmake6
-rw-r--r--Modules/FindJPEG.cmake2
-rw-r--r--Modules/GNUInstallDirs.cmake2
-rw-r--r--Modules/Internal/CheckCompilerFlag.cmake1
-rw-r--r--Modules/Platform/Android-Initialize.cmake5
-rw-r--r--Modules/Platform/Darwin.cmake4
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/cmDependsCompiler.cxx4
-rw-r--r--Source/cmGccDepfileReader.cxx8
-rw-r--r--Source/cmGccDepfileReader.h11
-rw-r--r--Tests/RunCMake/CMakeLists.txt13
-rw-r--r--Tests/TryCompile/CMakeLists.txt10
15 files changed, 55 insertions, 34 deletions
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst
index da27174d7..42e95beec 100644
--- a/Help/release/3.20.rst
+++ b/Help/release/3.20.rst
@@ -363,8 +363,8 @@ Changes made since CMake 3.20.0 include the following.
The oneAPI 2021.2 Fortran compiler defines the proper identification
macro and so is identified as ``IntelLLVM`` by all CMake 3.20 versions.
-3.20.3, 3.20.4, 3.20.5
-----------------------
+3.20.3, 3.20.4, 3.20.5, 3.20.6
+------------------------------
These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 14e1282c8..0bc8f5ade 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -33,9 +33,8 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
-#if !defined(__STDC__)
-# if (defined(_MSC_VER) && !defined(__clang__)) \
- || (defined(__ibmxl__) || defined(__IBMC__))
+#if !defined(__STDC__) && !defined(__clang__)
+# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
# define C_DIALECT "90"
# else
# define C_DIALECT
diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake
index fce2971ca..9b1c376b1 100644
--- a/Modules/Compiler/IntelLLVM-C.cmake
+++ b/Modules/Compiler/IntelLLVM-C.cmake
@@ -49,10 +49,6 @@ else()
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
endif()
-if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
- # FIXME: The compiler actually defaults to C17, but
- # CMake does not yet model or detect that standard.
- __compiler_check_default_language_standard(C 2020 11)
-else()
- set(CMAKE_C_STANDARD_DEFAULT "")
-endif()
+# FIXME: The compiler actually defaults to C17, but
+# CMake does not yet model or detect that standard.
+__compiler_check_default_language_standard(C 2020 11)
diff --git a/Modules/Compiler/IntelLLVM-CXX.cmake b/Modules/Compiler/IntelLLVM-CXX.cmake
index 4c0c26e2e..979988846 100644
--- a/Modules/Compiler/IntelLLVM-CXX.cmake
+++ b/Modules/Compiler/IntelLLVM-CXX.cmake
@@ -62,8 +62,4 @@ else()
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20")
endif()
-if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- __compiler_check_default_language_standard(CXX 2020 14)
-else()
- set(CMAKE_CXX_STANDARD_DEFAULT "")
-endif()
+__compiler_check_default_language_standard(CXX 2020 14)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index add2486c3..3f243ded5 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -58,7 +58,7 @@ Obsolete variables
find_path(JPEG_INCLUDE_DIR jpeglib.h)
-set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static turbojpeg turbojpeg-static)
+set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static)
foreach(name ${jpeg_names})
list(APPEND jpeg_names_debug "${name}d")
endforeach()
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index e149f4c5a..4016a6488 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -349,7 +349,7 @@ mark_as_advanced(
macro(GNUInstallDirs_get_absolute_install_dir absvar var)
set(GGAID_extra_args ${ARGN})
list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
- if(GGAID_extra_arg_count GREATER 0)
+ if(GGAID_extra_arg_count GREATER "0")
list(GET GGAID_extra_args 0 GGAID_dir)
else()
# Historical behaviour: use ${dir} from caller's scope
diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake
index 6b2a11e56..99efc372e 100644
--- a/Modules/Internal/CheckCompilerFlag.cmake
+++ b/Modules/Internal/CheckCompilerFlag.cmake
@@ -73,7 +73,6 @@ int main(void) { return 0; }]=])
foreach(v IN LISTS _locale_vars)
set(ENV{${v}} ${_locale_vars_saved_${v}})
endforeach()
- set(${_var} "${${_var}}" PARENT_SCOPE)
endfunction ()
cmake_policy(POP)
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index 50f06209f..63bc94917 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -56,11 +56,6 @@ if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
endif()
- # Don't search paths in PATH environment variable.
- if(NOT DEFINED CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH)
- set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
- endif()
-
# Allows CMake to find headers in the architecture-specific include directories.
set(CMAKE_LIBRARY_ARCHITECTURE "${CMAKE_ANDROID_ARCH_TRIPLE}")
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index d9a789475..839dc814e 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -47,7 +47,9 @@ set(CMAKE_SHARED_MODULE_PREFIX "lib")
set(CMAKE_SHARED_MODULE_SUFFIX ".so")
set(CMAKE_MODULE_EXISTS 1)
set(CMAKE_DL_LIBS "")
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+if(NOT "${_CURRENT_OSX_VERSION}" VERSION_LESS "10.5")
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+endif()
foreach(lang C CXX OBJC OBJCXX)
set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7a14f55ec..61668f488 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 20)
-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 [==[efa5e1f367 CMake 3.20.5]==])
+ set(git_info [==[0d3bfda22a CMake 3.20.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/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx
index 2b48df969..09f55997b 100644
--- a/Source/cmDependsCompiler.cxx
+++ b/Source/cmDependsCompiler.cxx
@@ -131,7 +131,9 @@ bool cmDependsCompiler::CheckDependencies(
depends.emplace_back(std::move(line));
}
} else if (format == "gcc"_s) {
- auto deps = cmReadGccDepfile(depFile.c_str());
+ auto deps = cmReadGccDepfile(
+ depFile.c_str(), this->LocalGenerator->GetCurrentBinaryDirectory(),
+ GccDepfilePrependPaths::Deps);
if (!deps) {
continue;
}
diff --git a/Source/cmGccDepfileReader.cxx b/Source/cmGccDepfileReader.cxx
index 6436baac8..d30dbc309 100644
--- a/Source/cmGccDepfileReader.cxx
+++ b/Source/cmGccDepfileReader.cxx
@@ -12,8 +12,9 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath,
- const std::string& prefix)
+cm::optional<cmGccDepfileContent> cmReadGccDepfile(
+ const char* filePath, const std::string& prefix,
+ GccDepfilePrependPaths prependPaths)
{
cmGccDepfileLexerHelper helper;
if (!helper.readFile(filePath)) {
@@ -23,7 +24,8 @@ cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath,
for (auto& dep : *deps) {
for (auto& rule : dep.rules) {
- if (!prefix.empty() && !cmSystemTools::FileIsFullPath(rule)) {
+ if (prependPaths == GccDepfilePrependPaths::All && !prefix.empty() &&
+ !cmSystemTools::FileIsFullPath(rule)) {
rule = cmStrCat(prefix, '/', rule);
}
if (cmSystemTools::FileIsFullPath(rule)) {
diff --git a/Source/cmGccDepfileReader.h b/Source/cmGccDepfileReader.h
index c8a37485c..243349244 100644
--- a/Source/cmGccDepfileReader.h
+++ b/Source/cmGccDepfileReader.h
@@ -8,8 +8,15 @@
#include "cmGccDepfileReaderTypes.h"
+enum class GccDepfilePrependPaths
+{
+ All,
+ Deps,
+};
+
/*
- * Read dependencies file and append prefix to all relative paths
+ * Read dependencies file and prepend prefix to all relative paths
*/
cm::optional<cmGccDepfileContent> cmReadGccDepfile(
- const char* filePath, const std::string& prefix = {});
+ const char* filePath, const std::string& prefix = {},
+ GccDepfilePrependPaths prependPaths = GccDepfilePrependPaths::All);
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c81796cfa..95f28f673 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -420,6 +420,19 @@ function(add_RunCMake_test_try_compile)
set(CMAKE_C_STANDARD_DEFAULT "")
endif()
endif()
+ if(CMAKE_VERSION VERSION_LESS 3.20.6 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xIntelLLVM" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ # Older CMake versions accidentally set the default standards to empty when
+ # IntelLLVM targets the MSVC ABI, thus not activating standard selection.
+ # Approximate the logic from IntelLLVM-{C,CXX}.cmake.
+ if(DEFINED CMAKE_C_STANDARD_DEFAULT AND "${CMAKE_C_STANDARD_DEFAULT}" STREQUAL "")
+ # FIXME: The compiler actually defaults to C17, but
+ # CMake does not yet model or detect that standard.
+ set(CMAKE_C_STANDARD_DEFAULT 11)
+ endif()
+ if(DEFINED CMAKE_CXX_STANDARD_DEFAULT AND "${CMAKE_CXX_STANDARD_DEFAULT}" STREQUAL "")
+ set(CMAKE_CXX_STANDARD_DEFAULT 14)
+ endif()
+ endif()
foreach(var
CMAKE_SYSTEM_NAME
CMAKE_C_COMPILER_ID
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 0c6b9382c..0d44f2184 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -305,11 +305,21 @@ unset(C_BOGUS_FLAG CACHE)
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG)
TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
+unset(C_BOGUS_FLAG CACHE)
+if(DEFINED C_BOGUS_FLAG)
+ # Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
+ message(SEND_ERROR "CHECK_C_COMPILER_FLAG shouldn't construct C_BOGUS_FLAG as a normal variable")
+endif()
unset(CXX_BOGUS_FLAG CACHE)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
+unset(CXX_BOGUS_FLAG CACHE)
+if(DEFINED CXX_BOGUS_FLAG)
+ # Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
+ message(SEND_ERROR "CHECK_CXX_COMPILER_FLAG shouldn't construct CXX_BOGUS_FLAG as a normal variable")
+endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
unset(C_STRICT_PROTOTYPES CACHE)