summaryrefslogtreecommitdiff
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx23
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 5f97d868f..3776fecc7 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -573,13 +573,6 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// Build the set of compiler flags.
std::string flags;
- // explicitly add the explicit language flag before any other flag
- // this way backwards compatibility with user flags is maintained
- if (source.GetProperty("LANGUAGE")) {
- this->LocalGenerator->AppendFeatureOptions(flags, lang,
- "EXPLICIT_LANGUAGE");
- }
-
// Add language-specific flags.
std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")");
this->LocalGenerator->AppendFlags(flags, langFlags);
@@ -838,13 +831,17 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
compileCommand.replace(compileCommand.find(langFlags), langFlags.size(),
this->GetFlags(lang, this->GetConfigName()));
std::string langDefines = std::string("$(") + lang + "_DEFINES)";
- compileCommand.replace(compileCommand.find(langDefines),
- langDefines.size(),
- this->GetDefines(lang, this->GetConfigName()));
+ std::string::size_type ldPos = compileCommand.find(langDefines);
+ if (ldPos != std::string::npos) {
+ compileCommand.replace(ldPos, langDefines.size(),
+ this->GetDefines(lang, this->GetConfigName()));
+ }
std::string langIncludes = std::string("$(") + lang + "_INCLUDES)";
- compileCommand.replace(compileCommand.find(langIncludes),
- langIncludes.size(),
- this->GetIncludes(lang, this->GetConfigName()));
+ std::string::size_type liPos = compileCommand.find(langIncludes);
+ if (liPos != std::string::npos) {
+ compileCommand.replace(liPos, langIncludes.size(),
+ this->GetIncludes(lang, this->GetConfigName()));
+ }
cmProp eliminate[] = {
this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"),