diff options
author | Brad King <brad.king@kitware.com> | 2016-10-07 18:57:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-07 19:02:42 (GMT) |
commit | dda6775c940129d2a38fecd6cf6273f7d97ccca0 (patch) | |
tree | 666c16239f6ed691e6575ea0a0d0d75982e033d6 /Source/cmExportBuildAndroidMKGenerator.cxx | |
parent | b99bbfe88d1bb02dc903507f3e1bbe716ac04c12 (diff) | |
download | CMake-dda6775c940129d2a38fecd6cf6273f7d97ccca0.zip CMake-dda6775c940129d2a38fecd6cf6273f7d97ccca0.tar.gz CMake-dda6775c940129d2a38fecd6cf6273f7d97ccca0.tar.bz2 |
Android: Record use of C++ by static libs in exported Android.mk files
When a `PREBUILT_STATIC_LIBRARY` uses C++ in its sources then the `.a`
file will have a link-time dependency on the C++ runtime libraries.
Android NDK r14 will add a way to give this information to the NDK build
system by adding a `LOCAL_HAS_CPP` setting to the `Android.mk` file.
Add this for exported static libraries that use C++.
Diffstat (limited to 'Source/cmExportBuildAndroidMKGenerator.cxx')
-rw-r--r-- | Source/cmExportBuildAndroidMKGenerator.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index bb02311..f5e6628 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -9,6 +9,8 @@ #include "cmMakefile.h" #include "cmTargetExport.h" +#include <algorithm> + cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator() { this->LG = CM_NULLPTR; @@ -164,6 +166,16 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( } } } + + // Tell the NDK build system if prebuilt static libraries use C++. + if (target->GetType() == cmState::STATIC_LIBRARY) { + cmLinkImplementation const* li = target->GetLinkImplementation(config); + if (std::find(li->Languages.begin(), li->Languages.end(), "CXX") != + li->Languages.end()) { + os << "LOCAL_HAS_CPP := true\n"; + } + } + switch (target->GetType()) { case cmState::SHARED_LIBRARY: case cmState::MODULE_LIBRARY: |