BUG: fix for bug 6834 RC should not get all COMPILE_FLAGS from a target and should work the same way as it does in the vs ide
This commit is contained in:
parent
7e5921eff4
commit
7f5446b2ef
@ -12,7 +12,10 @@ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
|||||||
SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
|
SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags for Fortran compiler.")
|
"Flags for Fortran compiler.")
|
||||||
|
|
||||||
|
# These are the only types of flags that should be passed to the rc
|
||||||
|
# command, if COMPILE_FLAGS is used on a target this will be used
|
||||||
|
# to filter out any other flags
|
||||||
|
SET(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
|
||||||
|
|
||||||
# now define the following rule variables
|
# now define the following rule variables
|
||||||
# CMAKE_RC_COMPILE_OBJECT
|
# CMAKE_RC_COMPILE_OBJECT
|
||||||
|
@ -491,8 +491,33 @@ cmMakefileTargetGenerator
|
|||||||
// Add target-specific flags.
|
// Add target-specific flags.
|
||||||
if(this->Target->GetProperty("COMPILE_FLAGS"))
|
if(this->Target->GetProperty("COMPILE_FLAGS"))
|
||||||
{
|
{
|
||||||
this->LocalGenerator->AppendFlags
|
std::string langIncludeExpr = "CMAKE_";
|
||||||
(flags, this->Target->GetProperty("COMPILE_FLAGS"));
|
langIncludeExpr += lang;
|
||||||
|
langIncludeExpr += "_FLAG_REGEX";
|
||||||
|
const char* regex = this->Makefile->
|
||||||
|
GetDefinition(langIncludeExpr.c_str());
|
||||||
|
if(regex)
|
||||||
|
{
|
||||||
|
cmsys::RegularExpression r(regex);
|
||||||
|
std::vector<std::string> args;
|
||||||
|
cmSystemTools::ParseWindowsCommandLine(
|
||||||
|
this->Target->GetProperty("COMPILE_FLAGS"),
|
||||||
|
args);
|
||||||
|
for(std::vector<std::string>::iterator i = args.begin();
|
||||||
|
i != args.end(); ++i)
|
||||||
|
{
|
||||||
|
if(r.find(i->c_str()))
|
||||||
|
{
|
||||||
|
this->LocalGenerator->AppendFlags
|
||||||
|
(flags, i->c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->LocalGenerator->AppendFlags
|
||||||
|
(flags, this->Target->GetProperty("COMPILE_FLAGS"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add flags from source file properties.
|
// Add flags from source file properties.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user