summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/3.9.rst7
-rw-r--r--Modules/CMakeCUDAInformation.cmake4
-rw-r--r--Modules/Platform/Android-Common.cmake1
-rw-r--r--Source/cmGeneratorTarget.cxx12
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx11
-rw-r--r--Source/cmLocalGenerator.cxx26
-rw-r--r--Source/cmNinjaTargetGenerator.cxx27
-rw-r--r--Templates/TestDriver.cxx.in4
-rw-r--r--Tests/RunCMake/Android/android_sysinc.c7
-rw-r--r--Tests/RunCMake/Android/android_sysinc.cxx7
-rw-r--r--Tests/RunCMake/Android/common.cmake16
-rw-r--r--Tests/RunCMake/Android/sysinc/dlfcn.h1
12 files changed, 99 insertions, 24 deletions
diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst
index c31f533..14e8699 100644
--- a/Help/release/3.9.rst
+++ b/Help/release/3.9.rst
@@ -34,6 +34,8 @@ Generators
This is an experimental feature and can be activated by setting the
:variable:`CMAKE_XCODE_GENERATE_SCHEME` variable to a ``TRUE`` value.
+* The :generator:`Xcode` generator now supports Xcode 9.
+
Commands
--------
@@ -319,3 +321,8 @@ Other Changes
* On macOS, ``RPATH`` settings such as :prop_tgt:`BUILD_WITH_INSTALL_RPATH`
no longer affect the ``install_name`` field. See policy :policy:`CMP0068`.
+
+* The :generator:`Visual Studio 14 2015` generator has been taught about
+ a change to the ``v140`` toolset made by a VS 2015 update. VS changed
+ the set of values it understands for the ``GenerateDebugInformation``
+ linker setting that produces the ``-DEBUG`` linker flag variants.
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 780e953..9bba847 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -104,7 +104,9 @@ include(CMakeCommonLanguageInclude)
# now define the following rules:
# CMAKE_CUDA_CREATE_SHARED_LIBRARY
# CMAKE_CUDA_CREATE_SHARED_MODULE
-# CMAKE_CUDA_COMPILE_OBJECT
+# CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
+# CMAKE_CUDA_COMPILE_PTX_COMPILATION
+# CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
# CMAKE_CUDA_LINK_EXECUTABLE
if(CMAKE_CUDA_HOST_COMPILER)
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index 6360376..5faada3 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -168,6 +168,5 @@ macro(__android_compiler_common lang)
else()
list(APPEND CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_SYSROOT}/usr/include")
endif()
- list(REMOVE_ITEM CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include")
endif()
endmacro()
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e8ecac4..329c7a9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2644,18 +2644,6 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
cmDeleteAll(linkInterfaceIncludeDirectoriesEntries);
- // Add standard include directories for this language.
- std::string const standardIncludesVar =
- "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const standardIncludes =
- this->Makefile->GetSafeDefinition(standardIncludesVar);
- std::vector<std::string>::size_type const before = includes.size();
- cmSystemTools::ExpandListArgument(standardIncludes, includes);
- for (std::vector<std::string>::iterator i = includes.begin() + before;
- i != includes.end(); ++i) {
- cmSystemTools::ConvertToUnixSlashes(*i);
- }
-
return includes;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9037961..3cd14e1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1517,6 +1517,17 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
+
+ cmXCodeObject* outputFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
+ i != commands.end(); ++i) {
+ std::vector<std::string> const& outputs = i->GetOutputs();
+ for (std::vector<std::string>::const_iterator j = outputs.begin();
+ j != outputs.end(); ++j) {
+ outputFiles->AddObject(this->CreateString(*j));
+ }
+ }
+ buildphase->AddAttribute("outputPaths", outputFiles);
}
void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8e00303..6ce31c5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -916,6 +916,20 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
}
+ // Add standard include directories for this language.
+ // We do not filter out implicit directories here.
+ std::string const standardIncludesVar =
+ "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const standardIncludes =
+ this->Makefile->GetSafeDefinition(standardIncludesVar);
+ std::vector<std::string>::size_type const before = includes.size();
+ cmSystemTools::ExpandListArgument(standardIncludes, includes);
+ for (std::vector<std::string>::iterator i = includes.begin() + before;
+ i != includes.end(); ++i) {
+ cmSystemTools::ConvertToUnixSlashes(*i);
+ dirs.push_back(*i);
+ }
+
for (std::vector<std::string>::const_iterator i = implicitDirs.begin();
i != implicitDirs.end(); ++i) {
if (std::find(includes.begin(), includes.end(), *i) != includes.end()) {
@@ -1577,7 +1591,11 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
const char* opt =
target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
- this->AppendFlagEscape(flags, opt);
+ std::vector<std::string> optVec;
+ cmSystemTools::ExpandListArgument(opt, optVec);
+ for (size_t i = 0; i < optVec.size(); ++i) {
+ this->AppendFlagEscape(flags, optVec[i]);
+ }
return;
}
@@ -1587,7 +1605,11 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
if (const char* opt =
target->Target->GetMakefile()->GetDefinition(option_flag)) {
- this->AppendFlagEscape(flags, opt);
+ std::vector<std::string> optVec;
+ cmSystemTools::ExpandListArgument(opt, optVec);
+ for (size_t i = 0; i < optVec.size(); ++i) {
+ this->AppendFlagEscape(flags, optVec[i]);
+ }
return;
}
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 2f4cccb..d38dbcb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1064,13 +1064,28 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
compileObjectVars.Includes = includes.c_str();
// Rule for compiling object file.
- std::string compileCmdVar = "CMAKE_";
- compileCmdVar += language;
- compileCmdVar += "_COMPILE_OBJECT";
- std::string compileCmd =
- this->GetMakefile()->GetRequiredDefinition(compileCmdVar);
std::vector<std::string> compileCmds;
- cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ if (language == "CUDA") {
+ std::string cmdVar;
+ if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_SEPARABLE_COMPILATION")) {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION");
+ } else if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_PTX_COMPILATION")) {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_PTX_COMPILATION");
+ } else {
+ cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
+ }
+ std::string compileCmd =
+ this->GetMakefile()->GetRequiredDefinition(cmdVar);
+ cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ } else {
+ const std::string cmdVar =
+ std::string("CMAKE_") + language + "_COMPILE_OBJECT";
+ std::string compileCmd =
+ this->GetMakefile()->GetRequiredDefinition(cmdVar);
+ cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
+ }
CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
this->GetLocalGenerator()->CreateRulePlaceholderExpander());
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index 0d3f44f..bf61be4 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -32,8 +32,8 @@ static functionMapEntry cmakeGeneratedFunctionMapEntries[] = {
{ NULL, NULL } /* NOLINT */
};
-static const int NumTests =
- (sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
+static const int NumTests = CM_CAST(int,
+ sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
/* Allocate and create a lowercased copy of string
(note that it has to be free'd manually) */
diff --git a/Tests/RunCMake/Android/android_sysinc.c b/Tests/RunCMake/Android/android_sysinc.c
new file mode 100644
index 0000000..18d73db
--- /dev/null
+++ b/Tests/RunCMake/Android/android_sysinc.c
@@ -0,0 +1,7 @@
+#include <dlfcn.h>
+
+#ifndef NOT_SYSTEM_DLFCN_HEADER
+#error "sysroot /usr/include appears too early"
+#endif
+
+#include "android.c"
diff --git a/Tests/RunCMake/Android/android_sysinc.cxx b/Tests/RunCMake/Android/android_sysinc.cxx
new file mode 100644
index 0000000..5c5694b
--- /dev/null
+++ b/Tests/RunCMake/Android/android_sysinc.cxx
@@ -0,0 +1,7 @@
+#include <dlfcn.h>
+
+#ifndef NOT_SYSTEM_DLFCN_HEADER
+#error "sysroot /usr/include appears too early"
+#endif
+
+#include "android.cxx"
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index bef2428..015f202 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -92,3 +92,19 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
endif()
add_executable(android_c android.c)
add_executable(android_cxx android.cxx)
+
+# Test that an explicit /usr/include is ignored in favor of
+# appearing as a standard include directory at the end.
+set(sysinc_dirs)
+if(CMAKE_ANDROID_NDK)
+ if(NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
+ list(APPEND sysinc_dirs ${CMAKE_SYSROOT_COMPILE}/usr/include)
+ else()
+ list(APPEND sysinc_dirs ${CMAKE_SYSROOT}/usr/include)
+ endif()
+endif()
+list(APPEND sysinc_dirs ${CMAKE_CURRENT_SOURCE_DIR}/sysinc)
+add_executable(android_sysinc_c android_sysinc.c)
+target_include_directories(android_sysinc_c SYSTEM PRIVATE ${sysinc_dirs})
+add_executable(android_sysinc_cxx android_sysinc.cxx)
+target_include_directories(android_sysinc_cxx SYSTEM PRIVATE ${sysinc_dirs})
diff --git a/Tests/RunCMake/Android/sysinc/dlfcn.h b/Tests/RunCMake/Android/sysinc/dlfcn.h
new file mode 100644
index 0000000..273306c
--- /dev/null
+++ b/Tests/RunCMake/Android/sysinc/dlfcn.h
@@ -0,0 +1 @@
+#define NOT_SYSTEM_DLFCN_HEADER