[Cmake-commits] CMake branch, next, updated. v3.3.1-2926-g4653dc3
Gregor Jasny
gjasny at googlemail.com
Mon Sep 14 15:18:42 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 4653dc36efc23e6a35449521a7d7a7688b0ab288 (commit)
via c4c34af1a8e951026178db532f18660e0a7f28bf (commit)
via 40a85b503c9eaa579c5b497f7f7155911f7a67c3 (commit)
from 35f46e30fe43345610408874db2504614bc72d47 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4653dc36efc23e6a35449521a7d7a7688b0ab288
commit 4653dc36efc23e6a35449521a7d7a7688b0ab288
Merge: 35f46e3 c4c34af
Author: Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Mon Sep 14 15:18:41 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 14 15:18:41 2015 -0400
Merge topic 'xcode-support-system-include' into next
c4c34af1 Swift: Add includes to OTHER_SWIFT_FLAGS in Xcode
40a85b50 Xcode: Obey SYSTEM keyword for includes (#15687)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4c34af1a8e951026178db532f18660e0a7f28bf
commit c4c34af1a8e951026178db532f18660e0a7f28bf
Author: Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Mon Sep 14 21:04:17 2015 +0200
Commit: Gregor Jasny <gjasny at googlemail.com>
CommitDate: Mon Sep 14 21:15:28 2015 +0200
Swift: Add includes to OTHER_SWIFT_FLAGS in Xcode
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 61ad928..85d3143 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -13,6 +13,7 @@
# License text for the above reference.)
set(CMAKE_Swift_OUTPUT_EXTENSION .o)
+set(CMAKE_INCLUDE_FLAG_Swift "-I")
# Load compiler-specific information.
if(CMAKE_Swift_COMPILER_ID)
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e131ddc..de1e506 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2300,6 +2300,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
buildSettings->AddAttribute("OTHER_CFLAGS",
this->CreateString(flags.c_str()));
}
+ else if (*li == "Swift")
+ {
+ buildSettings->AddAttribute("OTHER_SWIFT_FLAGS",
+ this->CreateString(flags.c_str()));
+ }
}
// Add Fortran source format attribute if property is set.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40a85b503c9eaa579c5b497f7f7155911f7a67c3
commit 40a85b503c9eaa579c5b497f7f7155911f7a67c3
Author: Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Mon Aug 31 22:33:37 2015 +0200
Commit: Gregor Jasny <gjasny at googlemail.com>
CommitDate: Mon Sep 14 21:15:11 2015 +0200
Xcode: Obey SYSTEM keyword for includes (#15687)
CMake used to put all header search paths into HEADER_SEARCH_PATHS
attribute. Unfortunately this attribute does not support to declare
a search path as a system include.
As a hack one could add a -isystem /path to the cflags but then include
ordering is not deterministic. A better approach was chosen with this
patch by not filling HEADER_SEARCH_PATHS at all and to populate
the C, C++, and Fortran flags directly. The include paths used by
Xcode should be now identical to the ones used by Unix Makefiles and
Ninja generator.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 33babec..e131ddc 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2177,34 +2177,27 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString("NO"));
}
- BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
- BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
- std::vector<std::string> includes;
- this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt,
- "C", configName);
- std::set<std::string> emitted;
- emitted.insert("/System/Library/Frameworks");
- for(std::vector<std::string>::iterator i = includes.begin();
- i != includes.end(); ++i)
+ for(std::set<std::string>::iterator li = languages.begin();
+ li != languages.end(); ++li)
{
- if(this->NameResolvesToFramework(i->c_str()))
- {
- std::string frameworkDir = *i;
- frameworkDir += "/../";
- frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
- if(emitted.insert(frameworkDir).second)
- {
- fdirs.Add(this->XCodeEscapePath(frameworkDir.c_str()).c_str());
- }
- }
- else
+ std::vector<std::string> includes;
+ this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, *li);
+
+ std::string includeFlags = this->CurrentLocalGenerator
+ ->GetIncludeFlags(includes, gtgt, *li, true, false, configName);
+
+ std::string& flags = cflags[*li];
+
+ if (!includeFlags.empty())
{
- std::string incpath =
- this->XCodeEscapePath(i->c_str());
- dirs.Add(incpath.c_str());
+ flags += " " + includeFlags;
}
}
+
// Add framework search paths needed for linking.
+ BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
+ std::set<std::string> emitted;
+ emitted.insert("/System/Library/Frameworks");
if(cmComputeLinkInformation* cli = gtgt->GetLinkInformation(configName))
{
std::vector<std::string> const& fwDirs = cli->GetFrameworkPaths();
@@ -2222,11 +2215,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
buildSettings->AddAttribute("FRAMEWORK_SEARCH_PATHS",
fdirs.CreateList());
}
- if(!dirs.IsEmpty())
- {
- buildSettings->AddAttribute("HEADER_SEARCH_PATHS",
- dirs.CreateList());
- }
bool same_gflags = true;
std::map<std::string, std::string> gflags;
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 9ee1957..1a4f43a 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -3,7 +3,8 @@ project(IncludeDirectories)
if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4)
OR CMAKE_C_COMPILER_ID STREQUAL Clang OR CMAKE_C_COMPILER_ID STREQUAL AppleClang)
- AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja"))
+ AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles"
+ OR CMAKE_GENERATOR STREQUAL "Ninja" OR CMAKE_GENERATOR STREQUAL "Xcode"))
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test)
if(run_sys_includes_test)
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index dcee85e..5078f30 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -15,10 +15,17 @@ target_include_directories(upstream SYSTEM PUBLIC
)
add_library(config_specific INTERFACE)
-set(testConfig ${CMAKE_BUILD_TYPE})
-target_include_directories(config_specific SYSTEM INTERFACE
- "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>"
-)
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ # CMAKE_BUILD_TYPE does not work here for multi-config generators
+ target_include_directories(config_specific SYSTEM INTERFACE
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_specific"
+ )
+else()
+ set(testConfig ${CMAKE_BUILD_TYPE})
+ target_include_directories(config_specific SYSTEM INTERFACE
+ "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>"
+ )
+endif()
add_library(consumer consumer.cpp)
target_link_libraries(consumer upstream config_specific)
-----------------------------------------------------------------------
Summary of changes:
Modules/CMakeSwiftInformation.cmake | 1 +
Source/cmGlobalXCodeGenerator.cxx | 49 +++++++++-----------
Tests/IncludeDirectories/CMakeLists.txt | 3 +-
.../SystemIncludeDirectories/CMakeLists.txt | 15 ++++--
4 files changed, 35 insertions(+), 33 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list