/src/CMake/Source/cmExportBuildAndroidMKGenerator.cxx
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #include "cmExportBuildAndroidMKGenerator.h" |
4 | | |
5 | | #include <functional> |
6 | | #include <sstream> |
7 | | #include <utility> |
8 | | #include <vector> |
9 | | |
10 | | #include "cmDiagnosticContext.h" |
11 | | #include "cmGeneratorExpression.h" |
12 | | #include "cmGeneratorTarget.h" |
13 | | #include "cmStringAlgorithms.h" |
14 | | #include "cmSystemTools.h" |
15 | | #include "cmTarget.h" |
16 | | |
17 | | cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator( |
18 | | cmDiagnosticContext context) |
19 | 0 | : cmExportBuildFileGenerator(std::move(context)) |
20 | 0 | { |
21 | 0 | } Unexecuted instantiation: cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator(cmDiagnosticContext) Unexecuted instantiation: cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator(cmDiagnosticContext) |
22 | | |
23 | | bool cmExportBuildAndroidMKGenerator::GenerateMainFile(std::ostream& os) |
24 | 0 | { |
25 | 0 | if (!this->CollectExports([&](cmGeneratorTarget const*) {})) { |
26 | 0 | return false; |
27 | 0 | } |
28 | | |
29 | | // Create all the imported targets. |
30 | 0 | for (auto const& exp : this->Exports) { |
31 | 0 | cmGeneratorTarget* gte = exp.Target; |
32 | |
|
33 | 0 | this->GenerateImportTargetCode(os, gte, this->GetExportTargetType(gte)); |
34 | |
|
35 | 0 | gte->Target->AppendBuildInterfaceIncludes(); |
36 | |
|
37 | 0 | ImportPropertyMap properties; |
38 | 0 | if (!this->PopulateInterfaceProperties(gte, properties)) { |
39 | 0 | return false; |
40 | 0 | } |
41 | | |
42 | 0 | this->PopulateInterfaceLinkLibrariesProperty( |
43 | 0 | gte, cmGeneratorExpression::BuildInterface, properties); |
44 | |
|
45 | 0 | this->GenerateInterfaceProperties(gte, os, properties); |
46 | 0 | } |
47 | | |
48 | 0 | return true; |
49 | 0 | } |
50 | | |
51 | | void cmExportBuildAndroidMKGenerator::GenerateImportHeaderCode( |
52 | | std::ostream& os, std::string const&) |
53 | 0 | { |
54 | 0 | os << "LOCAL_PATH := $(call my-dir)\n\n"; |
55 | 0 | } |
56 | | |
57 | | void cmExportBuildAndroidMKGenerator::GenerateImportTargetCode( |
58 | | std::ostream& os, cmGeneratorTarget const* target, |
59 | | cm::TargetType /*targetType*/) |
60 | 0 | { |
61 | 0 | std::string targetName = cmStrCat(this->Namespace, target->GetExportName()); |
62 | 0 | os << "include $(CLEAR_VARS)\n"; |
63 | 0 | os << "LOCAL_MODULE := "; |
64 | 0 | os << targetName << "\n"; |
65 | 0 | os << "LOCAL_SRC_FILES := "; |
66 | 0 | std::string const noConfig; // FIXME: What config to use here? |
67 | 0 | std::string path = |
68 | 0 | cmSystemTools::ConvertToOutputPath(target->GetFullPath(noConfig)); |
69 | 0 | os << path << "\n"; |
70 | 0 | } |