summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-04-13 12:46:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-06-07 11:32:52 (GMT)
commitde4da665d3205afa239749c41513a315c3831f51 (patch)
tree02ab204c77efc1a89b620b38c118913c06c125f8 /Source/cmMakefileLibraryTargetGenerator.cxx
parentbb879bcf2dd8a65eeb285ef67aa72c16aab01938 (diff)
downloadCMake-de4da665d3205afa239749c41513a315c3831f51.zip
CMake-de4da665d3205afa239749c41513a315c3831f51.tar.gz
CMake-de4da665d3205afa239749c41513a315c3831f51.tar.bz2
Use --sysroot when cross compiling.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 347f26d..36d1a5a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -589,6 +589,26 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
cmLocalGenerator::SHELL);
vars.ObjectDir = objdir.c_str();
vars.Target = targetOutPathReal.c_str();
+
+ if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ if (const char *rootPath =
+ this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"))
+ {
+ if (*rootPath)
+ {
+ if (const char *sysrootFlag =
+ this->Makefile->GetDefinition("CMAKE_SYSROOT_FLAG"))
+ {
+ linkFlags += " ";
+ linkFlags += sysrootFlag;
+ linkFlags += this->LocalGenerator->EscapeForShell(rootPath);
+ linkFlags += " ";
+ }
+ }
+ }
+ }
+
vars.LinkLibraries = linkLibs.c_str();
vars.ObjectsQuoted = buildObjs.c_str();
if (this->Target->HasSOName(this->ConfigName))