summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-03-14 19:03:16 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-03-14 19:03:16 (GMT)
commit88bd3b5281a146e1d1a31af4ab768a427341aedf (patch)
tree31bcd668e2890fabf59cfdd5c2e4f53bc2c82f7b /Source/cmMakefileLibraryTargetGenerator.cxx
parent8e702ac5a800fcd4fce0984b7a0e439b77d68ae9 (diff)
downloadCMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.zip
CMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.tar.gz
CMake-88bd3b5281a146e1d1a31af4ab768a427341aedf.tar.bz2
ENH: add support for removing language flags from shared library and shared module link commands
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 60303ea..4ae00db 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -246,16 +246,23 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
// Add the link message.
std::string buildEcho = "Linking ";
buildEcho += linkLanguage;
+ const char* forbiddenFlagVar = 0;
switch(this->Target->GetType())
{
case cmTarget::STATIC_LIBRARY:
- buildEcho += " static library "; break;
+ buildEcho += " static library ";
+ break;
case cmTarget::SHARED_LIBRARY:
- buildEcho += " shared library "; break;
+ forbiddenFlagVar = "_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS";
+ buildEcho += " shared library ";
+ break;
case cmTarget::MODULE_LIBRARY:
- buildEcho += " shared module "; break;
+ forbiddenFlagVar = "_CREATE_SHARED_MODULE_FORBIDDEN_FLAGS";
+ buildEcho += " shared module ";
+ break;
default:
- buildEcho += " library "; break;
+ buildEcho += " library ";
+ break;
}
buildEcho += targetOutPath.c_str();
this->LocalGenerator->AppendEcho(commands, buildEcho.c_str());
@@ -436,6 +443,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->LocalGenerator
->AddLanguageFlags(langFlags, linkLanguage,
this->LocalGenerator->m_ConfigurationName.c_str());
+ // remove any language flags that might not work with the
+ // particular os
+ if(forbiddenFlagVar)
+ {
+ this->RemoveForbiddenFlags(forbiddenFlagVar,
+ linkLanguage, langFlags);
+ }
vars.LanguageCompileFlags = langFlags.c_str();
// Expand placeholders in the commands.
this->LocalGenerator->m_TargetImplib = targetOutPathImport;