summaryrefslogtreecommitdiff
path: root/Source/cmExportBuildAndroidMKGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-02-15 08:42:07 -0500
committerBrad King <brad.king@kitware.com>2018-02-15 08:42:07 -0500
commit02edf08be2b9476f442b702c6c00447912425cc2 (patch)
treee599f112dca0aa108ab5ed8904cad44f4553d7f9 /Source/cmExportBuildAndroidMKGenerator.cxx
parent43cd9467cd2b0c1dde6e69a042032ea83422dbda (diff)
parentb6d68766b1a8537a3a130a38aa91936e579da6fd (diff)
downloadcmake-3.11.0-rc1.tar.gz
Merge branch 'export-android-mk' into release-3.11v3.11.0-rc1
Merge-request: !1766
Diffstat (limited to 'Source/cmExportBuildAndroidMKGenerator.cxx')
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx28
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index 6f31a2d7fa..817b5d9ebb 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -8,6 +8,7 @@
#include <utility>
#include "cmGeneratorExpression.h"
+#include "cmGeneratorExpressionDAGChecker.h"
#include "cmGeneratorTarget.h"
#include "cmLinkItem.h"
#include "cmLocalGenerator.h"
@@ -101,12 +102,21 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
os << "LOCAL_CPP_FEATURES += ";
os << (property.second) << "\n";
} else if (property.first == "INTERFACE_LINK_LIBRARIES") {
+ // evaluate any generator expressions with the current
+ // build type of the makefile
+ cmGeneratorExpression ge;
+ cmGeneratorExpressionDAGChecker dagChecker(
+ target->GetName(), "INTERFACE_LINK_LIBRARIES", nullptr, nullptr);
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(property.second);
+ std::string evaluated = cge->Evaluate(
+ target->GetLocalGenerator(), config, false, target, &dagChecker);
// need to look at list in pi->second and see if static or shared
// FindTargetToLink
// target->GetLocalGenerator()->FindGeneratorTargetToUse()
// then add to LOCAL_CPPFLAGS
std::vector<std::string> libraries;
- cmSystemTools::ExpandListArgument(property.second, libraries);
+ cmSystemTools::ExpandListArgument(evaluated, libraries);
std::string staticLibs;
std::string sharedLibs;
std::string ldlibs;
@@ -122,12 +132,6 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
staticLibs += " " + lib;
}
} else {
- // evaluate any generator expressions with the current
- // build type of the makefile
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(lib);
- std::string evaluated =
- cge->Evaluate(target->GetLocalGenerator(), config);
bool relpath = false;
if (type == cmExportBuildAndroidMKGenerator::INSTALL) {
relpath = lib.substr(0, 3) == "../";
@@ -135,12 +139,12 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
// check for full path or if it already has a -l, or
// in the case of an install check for relative paths
// if it is full or a link library then use string directly
- if (cmSystemTools::FileIsFullPath(evaluated) ||
- evaluated.substr(0, 2) == "-l" || relpath) {
- ldlibs += " " + evaluated;
+ if (cmSystemTools::FileIsFullPath(lib) ||
+ lib.substr(0, 2) == "-l" || relpath) {
+ ldlibs += " " + lib;
// if it is not a path and does not have a -l then add -l
- } else if (!evaluated.empty()) {
- ldlibs += " -l" + evaluated;
+ } else if (!lib.empty()) {
+ ldlibs += " -l" + lib;
}
}
}