diff options
author | Brad King <brad.king@kitware.com> | 2013-06-24 12:46:12 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-06-24 12:46:12 (GMT) |
commit | b2d70c1a20caf8011a1cc8b9fe5fb59a614dd959 (patch) | |
tree | ea4bfbb83021fe81c54bd857c7dc8183ea4fb1f6 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 059be4ba3b8af00f3615726ba8d3ff485e2fcef4 (diff) | |
parent | de4da665d3205afa239749c41513a315c3831f51 (diff) | |
download | CMake-b2d70c1a20caf8011a1cc8b9fe5fb59a614dd959.zip CMake-b2d70c1a20caf8011a1cc8b9fe5fb59a614dd959.tar.gz CMake-b2d70c1a20caf8011a1cc8b9fe5fb59a614dd959.tar.bz2 |
Merge topic 'set-sysroot'
de4da66 Use --sysroot when cross compiling.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 137654b..6d352ed 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -224,7 +224,27 @@ cmNinjaNormalTargetGenerator vars.TargetVersionMajor = targetVersionMajor.c_str(); vars.TargetVersionMinor = targetVersionMinor.c_str(); - vars.Flags = "$FLAGS"; + + std::string flags = "$FLAGS"; + + if (const char *rootPath = + this->GetMakefile()->GetSafeDefinition("CMAKE_SYSROOT")) + { + if (*rootPath) + { + if (const char *sysrootFlag = + this->GetMakefile()->GetDefinition("CMAKE_SYSROOT_FLAG")) + { + flags += " "; + flags += sysrootFlag; + flags += this->GetLocalGenerator()->EscapeForShell(rootPath); + flags += " "; + } + } + } + + vars.Flags = flags.c_str(); + vars.LinkFlags = "$LINK_FLAGS"; std::string langFlags; |