From 224bed4c86ac34bc01b2a89ba5ce22608ecb14ce Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 12 Jun 2018 11:09:39 +0100 Subject: [PATCH] Android: Added binary location support when building Android static libraries --- .../ProjectSaving/jucer_ProjectExport_Android.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h index cdec23bcbc..21aa0d9ea2 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Android.h @@ -467,8 +467,21 @@ private: mo << (first ? "IF" : "ELSEIF") << "(JUCE_BUILD_CONFIGURATION MATCHES \"" << cfg.getProductFlavourCMakeIdentifier() <<"\")" << newLine; if (isLibrary()) + { mo << " SET(BINARY_NAME \"" << getNativeModuleBinaryName (cfg) << "\")" << newLine; + auto binaryLocation = cfg.getTargetBinaryRelativePathString(); + + if (binaryLocation.isNotEmpty()) + { + auto locationRelativeToCmake = RelativePath (binaryLocation, RelativePath::projectFolder) + .rebased (getProject().getFile().getParentDirectory(), + file.getParentDirectory(), RelativePath::buildTargetFolder); + + mo << " SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY \"" << "../../../../" << locationRelativeToCmake.toUnixStyle() << "\")" << newLine; + } + } + writeCmakePathLines (mo, " ", "link_directories(", libSearchPaths); if (cfgDefines.size() > 0)