summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 10b7849..f31b1a8 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -686,6 +686,23 @@ cmMakefileTargetGenerator
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
vars.ObjectDir = objectDir.c_str();
+
+ if (const char *rootPath =
+ this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"))
+ {
+ if (*rootPath)
+ {
+ if (const char *sysrootFlag =
+ this->Makefile->GetDefinition("CMAKE_SYSROOT_FLAG"))
+ {
+ flags += " ";
+ flags += sysrootFlag;
+ flags += this->LocalGenerator->EscapeForShell(rootPath);
+ flags += " ";
+ }
+ }
+ }
+
vars.Flags = flags.c_str();
std::string definesString = "$(";