diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-05-16 12:59:04 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-06-02 09:56:36 (GMT) |
commit | 35496761a58956bd8c5ad65a3ed9ee78d09af56b (patch) | |
tree | f02c889f4da5c1da5d9a6eef5d9ea73fbc0f1a16 /Source/cmNinjaTargetGenerator.cxx | |
parent | f3ad863ae6f0487bbf80d95b0d3f622840187a6a (diff) | |
download | CMake-35496761a58956bd8c5ad65a3ed9ee78d09af56b.zip CMake-35496761a58956bd8c5ad65a3ed9ee78d09af56b.tar.gz CMake-35496761a58956bd8c5ad65a3ed9ee78d09af56b.tar.bz2 |
Add cmLocalGenerator::GetCompileOptions.
Currently it only adds the contents of the COMPILE_FLAGS target
property, but it can be extended to handle a new COMPILE_OPTIONS
generator expression enabled property.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 850e5ea..141e014 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -151,9 +151,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, this->GetConfigName()); // Add include directory flags. + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); { std::vector<std::string> includes; - const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget, language.c_str(), config); @@ -171,7 +171,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, this->LocalGenerator->AppendFlags(flags, this->Makefile->GetDefineFlags()); // Add target-specific flags. - if(this->Target->GetProperty("COMPILE_FLAGS")) + std::string targetFlags; + this->LocalGenerator->GetCompileOptions(targetFlags, this->Target, config); + if(!targetFlags.empty()) { std::string langIncludeExpr = "CMAKE_"; langIncludeExpr += language; @@ -183,7 +185,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, cmsys::RegularExpression r(regex); std::vector<std::string> args; cmSystemTools::ParseWindowsCommandLine( - this->Target->GetProperty("COMPILE_FLAGS"), + targetFlags.c_str(), args); for(std::vector<std::string>::iterator i = args.begin(); i != args.end(); ++i) @@ -198,7 +200,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source, else { this->LocalGenerator->AppendFlags - (flags, this->Target->GetProperty("COMPILE_FLAGS")); + (flags, targetFlags.c_str()); } } |