diff options
author | Alan W. Irwin <airwin@users.sourceforge.net> | 2019-08-24 19:44:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-27 17:49:54 (GMT) |
commit | 79b282425185b70426716f23feb06e7e9e6ed752 (patch) | |
tree | 5e63d8a649d770a80dbc103daeca59f83fbb3664 /Source/cmComputeLinkInformation.cxx | |
parent | 843ab7544e319597306a6d9cea4ab8be3296e6c4 (diff) | |
download | CMake-79b282425185b70426716f23feb06e7e9e6ed752.zip CMake-79b282425185b70426716f23feb06e7e9e6ed752.tar.gz CMake-79b282425185b70426716f23feb06e7e9e6ed752.tar.bz2 |
Add per-lang variants of CMAKE_LINK_LIBRARY_{FILE_FLAG,SUFFIX}
Extend the change from commit 689be6235e (Generator: support
per-language link library flag, 2019-08-08) to cover more link library
command-line flag components. Allow compilers for different languages
to use different values for these linking-related variables within the
same build.
Closes: #19631
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 880d5c0..dd8d246 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -292,10 +292,20 @@ cmComputeLinkInformation::cmComputeLinkInformation( this->LibLinkFlag = this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FLAG"); } - this->LibLinkFileFlag = - this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FILE_FLAG"); - this->LibLinkSuffix = - this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"); + if (const char* flag = this->Makefile->GetDefinition( + "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_FILE_FLAG")) { + this->LibLinkFileFlag = flag; + } else { + this->LibLinkFileFlag = + this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_FILE_FLAG"); + } + if (const char* suffix = this->Makefile->GetDefinition( + "CMAKE_" + this->LinkLanguage + "_LINK_LIBRARY_SUFFIX")) { + this->LibLinkSuffix = suffix; + } else { + this->LibLinkSuffix = + this->Makefile->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"); + } // Get options needed to specify RPATHs. this->RuntimeUseChrpath = false; |