diff options
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 20 |
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)) |