summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--Help/release/3.15.rst9
-rw-r--r--Modules/FindPython/Support.cmake2
-rw-r--r--Modules/GetPrerequisites.cmake6
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/cmLinkLineComputer.cxx8
-rw-r--r--Source/cmLocalGenerator.cxx7
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Tests/RunCMake/target_link_libraries/ConfigCase-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt13
-rw-r--r--Tests/RunCMake/target_link_libraries/ConfigCase.cmake6
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake8
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt19
13 files changed, 79 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da99a6ee8..57620992b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -368,7 +368,7 @@ macro (CMAKE_BUILD_UTILITIES)
# Setup third-party libraries.
# Everything in the tree should be able to include files from the
# Utilities directory.
- if (CMAKE_SYSTEM_NAME STREQUAL "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using -isystem option generate error "template with C linkage"
include_directories("${CMake_SOURCE_DIR}/Utilities/std")
else()
@@ -841,6 +841,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
+ PATTERN "ExportImportList"
+ PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
REGEX "Help/(dev|guide)($|/)" EXCLUDE
)
diff --git a/Help/release/3.15.rst b/Help/release/3.15.rst
index 957e6e958..e68e7d38b 100644
--- a/Help/release/3.15.rst
+++ b/Help/release/3.15.rst
@@ -332,6 +332,15 @@ Deprecated and Removed Features
Other Changes
=============
+* If a feature specified by :command:`target_compile_features` is available
+ in the compiler's default standard level, CMake 3.14 and below incorrectly
+ added unnecessary ``-std=`` flags that could lower the standard level.
+ This bug has been fixed in CMake 3.15. This behavior change may expose
+ bugs in existing projects that were relying on undocumented implementation
+ details. Specifying compile features only ensures that the compiler runs
+ in a mode that has those features, not that any specific standard level is
+ used or explicit ``-std=`` flag passed.
+
* CMake learned how to compile C++14 with the IBM AIX XL compiler
and the SunPro compiler and to compile C++20 with the AppleClang compiler.
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 67db4d381..50dd7ba08 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -953,7 +953,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
- if (NOT _${_PYTHON_PREFIX}_FIND_VIRTUALENV STREQUAL "ONLY")
+ if (_${_PYTHON_PREFIX}_FIND_VIRTUALENV STREQUAL "ONLY")
break()
endif()
endif()
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 57ae44675..5c8c19671 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -531,7 +531,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
string(TOLOWER "$ENV{windir}" windir)
file(TO_CMAKE_PATH "${windir}" windir)
- if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-)[^/]+dll)")
+ if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-|vcruntime)[^/]+dll)")
set(is_system 1)
endif()
@@ -559,7 +559,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
string(TOLOWER "${env_windir}" windir)
string(TOLOWER "${env_sysdir}" sysroot)
- if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-)[^/]+dll)")
+ if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-|vcruntime)[^/]+dll)")
set(is_system 1)
endif()
endif()
@@ -601,7 +601,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(NOT is_embedded)
if(NOT IS_ABSOLUTE "${resolved_file}")
- if(lower MATCHES "^(msvc|api-ms-win-)[^/]+dll" AND is_system)
+ if(lower MATCHES "^(msvc|api-ms-win-|vcruntime)[^/]+dll" AND is_system)
message(STATUS "info: non-absolute msvc file '${file}' returning type '${type}'")
else()
message(STATUS "warning: gp_resolved_file_type non-absolute file '${file}' returning type '${type}' -- possibly incorrect")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 010c8d643..3210fa201 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 16)
-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 [==[b7d8c91822 CMake 3.16.5]==])
+ set(git_info [==[4c82f309c5 CMake 3.16.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/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 3d516f803..3fc41cf78 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -142,9 +142,11 @@ void cmLinkLineComputer::ComputeLinkPath(
type = cmStateEnums::ImportLibraryArtifact;
}
- linkPathNoBT += cmStrCat(
- " ", libPathFlag, item.Target->GetDirectory(cli.GetConfig(), type),
- libPathTerminator, " ");
+ linkPathNoBT +=
+ cmStrCat(" ", libPathFlag,
+ this->ConvertToOutputForExisting(
+ item.Target->GetDirectory(cli.GetConfig(), type)),
+ libPathTerminator, " ");
}
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffd46d454..af92e1b0c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2306,11 +2306,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
if (!this->GetGlobalGenerator()->IsMultiConfig()) {
config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
}
- const std::string buildType = cmSystemTools::UpperCase(config);
// FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources, buildType);
+ target->GetSourceFiles(sources, config);
for (const std::string& lang : { "C", "CXX", "OBJC", "OBJCXX" }) {
auto langSources =
@@ -2481,15 +2480,13 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
}
- const std::string buildType = cmSystemTools::UpperCase(config);
-
std::string filename_base =
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/",
target->GetName(), ".dir/Unity/");
// FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources, buildType);
+ target->GetSourceFiles(sources, config);
auto batchSizeString = target->GetProperty("UNITY_BUILD_BATCH_SIZE");
const size_t unityBatchSize =
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4a70248d6..919fb74a2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -712,6 +712,10 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop(
;
/* clang-format on */
} else {
+ makefileStream << "# Command-line flag to silence nested $(MAKE).\n"
+ "$(VERBOSE)MAKESILENT = -s\n"
+ "\n";
+
// Write special target to silence make output. This must be after
// the default target in case VERBOSE is set (which changes the
// name). The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a
@@ -1910,7 +1914,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
{
// Call make on the given file.
std::string cmd = cmStrCat(
- "$(MAKE) -f ",
+ "$(MAKE) $(MAKESILENT) -f ",
this->ConvertToOutputFormat(makefile, cmOutputConverter::SHELL), ' ');
cmGlobalUnixMakefileGenerator3* gg =
diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt b/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/ConfigCase-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt b/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt
new file mode 100644
index 000000000..953c9729e
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/ConfigCase-stderr.txt
@@ -0,0 +1,13 @@
+^CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\):
+ Target "impl" links to target "config::impl-Debug" but the target was not
+ found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
+ an ALIAS target is missing\?
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at ConfigCase.cmake:[0-9]+ \(add_library\):
+ Target "impl" links to target "config::iface-Debug" but the target was not
+ found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
+ an ALIAS target is missing\?
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/ConfigCase.cmake b/Tests/RunCMake/target_link_libraries/ConfigCase.cmake
new file mode 100644
index 000000000..fc394781b
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/ConfigCase.cmake
@@ -0,0 +1,6 @@
+cmake_policy(VERSION 3.15)
+enable_language(C)
+add_library(iface INTERFACE)
+target_link_libraries(iface INTERFACE "config::iface-$<CONFIG>")
+add_library(impl empty.c)
+target_link_libraries(impl PRIVATE "config::impl-$<CONFIG>" iface)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 0152d4c67..8eed98619 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -1,5 +1,13 @@
include(RunCMake)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
+else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+endif()
+run_cmake(ConfigCase)
+unset(RunCMake_TEST_OPTIONS)
+
run_cmake(CMP0023-WARN)
run_cmake(CMP0023-NEW)
run_cmake(CMP0023-WARN-2)
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index fe2ef756c..7625cf65d 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -137,6 +137,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
+ list(APPEND uv_headers
+ include/uv/posix.h
+ )
+ list(APPEND uv_defines
+ _ALL_SOURCE
+ _XOPEN_SOURCE=500
+ _LINUX_SOURCE_COMPAT
+ _THREAD_SAFE
+ )
+ list(APPEND uv_sources
+ src/unix/aix-common.c
+ src/unix/ibmi.c
+ src/unix/posix-poll.c
+ src/unix/no-fsevents.c
+ src/unix/no-proctitle.c
+ )
+endif()
+
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
list(APPEND uv_libraries
)