Notes |
|
(0037087)
|
Ilya
|
2014-10-28 13:30
|
|
This is only relevant for the Xcode generator. |
|
|
(0037088)
|
Brad King
|
2014-10-28 14:07
|
|
Historically the goal of the Xcode generator in CMake has been to make projects that use CMake build with Xcode, not to generate pretty projects like a human might. Lots more work would be needed to make each flag go to the right project attribute instead of putting them all in OTHER_CFLAGS. (The VS generator does this already, but the Xcode generator does not.) However, the build should work.
CMAKE_XCODE_ATTRIBUTE_ is meant for settings that CMake doesn't otherwise know how to generate. CMake does have a place to put the value of CMAKE_C_FLAGS, which should be used for any warning flags you need. They will go in OTHER_CFLAGS and the build should work. |
|
|
(0037091)
|
Ilya
|
2014-10-28 16:26
(edited on: 2014-10-28 16:28) |
|
Can you explain why CMake uncoditionally sets these flags to WARNING_CFLAGS?
I believe that in this particular case CMake should at least inherit unless user specifically overrides thi attributes by either using variable or target property.
|
|
|
(0037099)
|
Brad King
|
2014-10-29 09:30
|
|
Re 0015224:0037091: From the history it looks like it was part of the generator when it was first created. Perhaps it was trying to duplicate something Xcode generated in new projects back then.
Try this patch (untested):
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 13e6988..5e7a898 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2314,6 +2314,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
group->AddObject(this->CreateString("-Wmost"));
group->AddObject(this->CreateString("-Wno-four-char-constants"));
group->AddObject(this->CreateString("-Wno-unknown-pragmas"));
+ group->AddObject(this->CreateString("$(inherited)"));
buildSettings->AddAttribute("WARNING_CFLAGS", group);
}
else |
|
|
(0037100)
|
Brad King
|
2014-10-29 09:31
|
|
As discussed in 0015225 you should be able to do just
add_compile_options(
-Wno-long-long
)
prior to creating targets and the options will end up on the compilation line. |
|
|
(0037102)
|
Ilya
|
2014-10-29 13:26
|
|
Brad, this patch works :) Will you apply it to mainstream? |
|
|
(0037109)
|
Brad King
|
2014-10-30 13:35
(edited on: 2014-10-31 11:31) |
|
|
|
(0037115)
|
Ruslan Baratov
|
2014-10-31 10:23
|
|
|
|
(0038437)
|
Robert Maynard
|
2015-04-06 09:07
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|