summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-10 13:40:01 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-11 17:17:11 (GMT)
commit94a75801c834891f47358e9f5763c56245dff3fe (patch)
treec0292b4c42c1327044d76eecc2aa7a131dc51ead /Source
parent8a63b23d1606e4eb04e729369fa5ecccc2f5c7ea (diff)
downloadCMake-94a75801c834891f47358e9f5763c56245dff3fe.zip
CMake-94a75801c834891f47358e9f5763c56245dff3fe.tar.gz
CMake-94a75801c834891f47358e9f5763c56245dff3fe.tar.bz2
Android.mk: De-duplicate link libraries logic during export
Use the normal target link interface computation logic to get the list of libraries in the link interface instead of trying to interpret the `INTERFACE_LINK_LIBRARIES` property directly.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx26
1 files changed, 5 insertions, 21 deletions
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index 3d32b84..d12ad7f 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -8,11 +8,8 @@
#include <utility>
#include "cmAlgorithms.h"
-#include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionDAGChecker.h"
#include "cmGeneratorTarget.h"
#include "cmLinkItem.h"
-#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
@@ -104,27 +101,14 @@ 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, "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(evaluated, libraries);
std::string staticLibs;
std::string sharedLibs;
std::string ldlibs;
- for (std::string const& lib : libraries) {
- cmGeneratorTarget* gt =
- target->GetLocalGenerator()->FindGeneratorTargetToUse(lib);
+ cmLinkInterfaceLibraries const* linkIFace =
+ target->GetLinkInterfaceLibraries(config, target, false);
+ for (cmLinkItem const& item : linkIFace->Libraries) {
+ cmGeneratorTarget const* gt = item.Target;
+ std::string const& lib = item.AsStr();
if (gt) {
if (gt->GetType() == cmStateEnums::SHARED_LIBRARY ||