summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-21 14:05:09 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-22 12:15:32 (GMT)
commit4468acb979d04fc422a1c78a89c24a26b35f3629 (patch)
tree5bd15416fde53ba8a87dd2f0debe189944737957 /Source/cmGeneratorTarget.cxx
parentfa6db3738a61d341132aa091becd39ddf75a2bec (diff)
downloadCMake-4468acb979d04fc422a1c78a89c24a26b35f3629.zip
CMake-4468acb979d04fc422a1c78a89c24a26b35f3629.tar.gz
CMake-4468acb979d04fc422a1c78a89c24a26b35f3629.tar.bz2
CUDA: Factor runtime library lookup into helper method
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 917985a..f2a51ab 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5710,6 +5710,25 @@ void cmGeneratorTarget::GetTargetVersion(const std::string& property,
}
}
+std::string cmGeneratorTarget::GetRuntimeLinkLibrary(
+ std::string const& lang, std::string const& config) const
+{
+ // This is activated by the presence of a default selection whether or
+ // not it is overridden by a property.
+ cmProp runtimeLibraryDefault = this->Makefile->GetDef(
+ cmStrCat("CMAKE_", lang, "_RUNTIME_LIBRARY_DEFAULT"));
+ if (!runtimeLibraryDefault || runtimeLibraryDefault->empty()) {
+ return std::string();
+ }
+ cmProp runtimeLibraryValue =
+ this->Target->GetProperty(cmStrCat(lang, "_RUNTIME_LIBRARY"));
+ if (!runtimeLibraryValue) {
+ runtimeLibraryValue = runtimeLibraryDefault;
+ }
+ return cmSystemTools::UpperCase(cmGeneratorExpression::Evaluate(
+ *runtimeLibraryValue, this->LocalGenerator, config, this));
+}
+
std::string cmGeneratorTarget::GetFortranModuleDirectory(
std::string const& working_dir) const
{