diff options
author | Brad King <brad.king@kitware.com> | 2013-06-27 16:04:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-27 16:57:32 (GMT) |
commit | d221eac81261679d3580849218220290fcd122df (patch) | |
tree | 15df696e0e790c05387fd0441d52110e16a71ec1 /Source/cmExtraSublimeTextGenerator.cxx | |
parent | b6385cabec5356b471dc37bd999d1803555ba386 (diff) | |
download | CMake-d221eac81261679d3580849218220290fcd122df.zip CMake-d221eac81261679d3580849218220290fcd122df.tar.gz CMake-d221eac81261679d3580849218220290fcd122df.tar.bz2 |
Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling
Replace the cmLocalGenerator GetCompileOptions method with an
AddCompileOptions method since all call sites of the former simply
append the result to a flags string anyway.
Add a "lang" argument to AddCompileOptions and move the
CMAKE_<LANG>_FLAGS_REGEX filter into it. Move the call sites in each
generator to a location that has both the language and configuration
available. In the Makefile generator this also moves the flags from
build.make to flags.make where they belong.
Diffstat (limited to 'Source/cmExtraSublimeTextGenerator.cxx')
-rw-r--r-- | Source/cmExtraSublimeTextGenerator.cxx | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 29d86a6..012013c 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -429,34 +429,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source, lg->AppendFlags(flags, makefile->GetDefineFlags()); // Add target-specific flags. - std::string targetFlags; - lg->GetCompileOptions(targetFlags, target, config); - if (!targetFlags.empty()) - { - std::string langIncludeExpr = "CMAKE_"; - langIncludeExpr += language; - langIncludeExpr += "_FLAG_REGEX"; - const char* regex = makefile->GetDefinition(langIncludeExpr.c_str()); - if(regex) - { - cmsys::RegularExpression r(regex); - std::vector<std::string> args; - cmSystemTools:: - ParseWindowsCommandLine(targetFlags.c_str(), args); - for(std::vector<std::string>::iterator i = args.begin(); - i != args.end(); ++i) - { - if(r.find(i->c_str())) - { - lg->AppendFlags(flags, i->c_str()); - } - } - } - else - { - lg->AppendFlags(flags, targetFlags.c_str()); - } - } + lg->AddCompileOptions(flags, target, config, language); // Add source file specific flags. lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS")); |