summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-08 17:04:04 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-08 17:04:04 (GMT)
commit173448d9886deccb7cadd4fd0ffeaa236fa66e49 (patch)
tree12ef68b6607c5b223cd5e962d2e63d3ba8e68b69 /Source
parenta3a046643aeb6244ac71a3cd645239099c6345f3 (diff)
downloadCMake-173448d9886deccb7cadd4fd0ffeaa236fa66e49.zip
CMake-173448d9886deccb7cadd4fd0ffeaa236fa66e49.tar.gz
CMake-173448d9886deccb7cadd4fd0ffeaa236fa66e49.tar.bz2
ENH: Pass config to cmTarget::GetLinkerLanguage
This passes the build configuration to most GetLinkerLanguage calls. In the future the linker language will account for targets linked in each configuration.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx4
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx3
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx15
-rw-r--r--Source/cmTarget.cxx8
-rw-r--r--Source/cmTarget.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx9
8 files changed, 27 insertions, 18 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 4ca6817..66d355d 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -264,7 +264,7 @@ cmComputeLinkInformation
this->OrderDependentRPath = 0;
// Get the language used for linking this target.
- this->LinkLanguage = this->Target->GetLinkerLanguage();
+ this->LinkLanguage = this->Target->GetLinkerLanguage(config);
if(!this->LinkLanguage)
{
// The Compute method will do nothing, so skip the rest of the
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3d5291a..5f22946 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1378,7 +1378,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY));
- const char* lang = target.GetLinkerLanguage();
+ const char* lang = target.GetLinkerLanguage(configName);
std::string cflags;
if(lang)
{
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7ca3f8c..7fb04b1 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -656,7 +656,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
std::string flags;
if(strcmp(configType, "10") != 0)
{
- const char* linkLanguage = target.GetLinkerLanguage();
+ const char* linkLanguage = target.GetLinkerLanguage(configName);
if(!linkLanguage)
{
cmSystemTools::Error
@@ -1362,7 +1362,7 @@ cmLocalVisualStudio7GeneratorFCInfo
lg->GlobalGenerator->GetLanguageFromExtension
(sf.GetExtension().c_str());
const char* sourceLang = lg->GetSourceFileLanguage(sf);
- const char* linkLanguage = target.GetLinkerLanguage();
+ const char* linkLanguage = target.GetLinkerLanguage(i->c_str());
bool needForceLang = false;
// source file does not match its extension language
if(lang && sourceLang && strcmp(lang, sourceLang) != 0)
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e9ac80c..c269afc 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -178,7 +178,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
cmLocalGenerator::SHELL);
// Get the language to use for linking this executable.
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
// Make sure we have a link language.
if(!linkLanguage)
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 9c92824..9a5f7fd 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -109,7 +109,8 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
{
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
std::string linkRuleVar = "CMAKE_";
if (linkLanguage)
{
@@ -131,7 +132,8 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
this->WriteFrameworkRules(relink);
return;
}
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
std::string linkRuleVar = "CMAKE_";
if (linkLanguage)
{
@@ -176,7 +178,8 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
{
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
std::string linkRuleVar = "CMAKE_";
if (linkLanguage)
{
@@ -201,7 +204,8 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
{
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
std::string linkRuleVar = "CMAKE_";
if (linkLanguage)
{
@@ -347,7 +351,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
// Get the language to use for linking this library.
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->ConfigName);
// Make sure we have a link language.
if(!linkLanguage)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4003190..32c1688 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2320,7 +2320,7 @@ bool cmTarget::GetPropertyAsBool(const char* prop)
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetLinkerLanguage()
+const char* cmTarget::GetLinkerLanguage(const char*)
{
cmGlobalGenerator* gg =
this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
@@ -2772,7 +2772,7 @@ void cmTarget::GetLibraryNames(std::string& name,
}
// Construct the name of the soname flag variable for this language.
- const char* ll = this->GetLinkerLanguage();
+ const char* ll = this->GetLinkerLanguage(config);
std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME";
if(ll)
{
@@ -3062,7 +3062,7 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config)
}
// Check for rpath support on this platform.
- if(const char* ll = this->GetLinkerLanguage())
+ if(const char* ll = this->GetLinkerLanguage(config))
{
std::string flagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
flagVar += ll;
@@ -3387,7 +3387,7 @@ bool cmTarget::IsChrpathUsed(const char* config)
// Enable if the rpath flag uses a separator and the target uses ELF
// binaries.
- if(const char* ll = this->GetLinkerLanguage())
+ if(const char* ll = this->GetLinkerLanguage(config))
{
std::string sepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
sepVar += ll;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4ce6b30..63e8516 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -305,7 +305,7 @@ public:
bool FindSourceFiles();
///! Return the prefered linker language for this target
- const char* GetLinkerLanguage();
+ const char* GetLinkerLanguage(const char* config = 0);
///! Return the rule variable used to create this type of target,
// need to add CMAKE_(LANG) for full name.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index bae892d..065f454 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -582,7 +582,8 @@ OutputLinkIncremental(std::string const& configName)
// assume incremental linking
const char* incremental = "true";
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(configName.c_str());
if(!linkLanguage)
{
cmSystemTools::Error
@@ -638,7 +639,8 @@ WriteClOptions(std::string const& configName,
// collect up flags for
if(this->Target->GetType() < cmTarget::UTILITY)
{
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(configName.c_str());
if(!linkLanguage)
{
cmSystemTools::Error
@@ -772,7 +774,8 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
{
return;
}
- const char* linkLanguage = this->Target->GetLinkerLanguage();
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(config.c_str());
if(!linkLanguage)
{
cmSystemTools::Error