-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathwin2android.cpp
More file actions
80 lines (67 loc) · 2.84 KB
/
win2android.cpp
File metadata and controls
80 lines (67 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
void configure(Build &b)
{
auto &s = b.addCustomSolution();
s.Settings.TargetOS.Type = OSType::Android;
s.Settings.TargetOS.Arch = ArchType::aarch64;
s.Settings.Native.CompilerType = CompilerType::Clang;
s.Settings.Native.SDK.setAndroidApiVersion(24);
{
{
auto Librarian = std::make_shared<GNULibrarian>();
Librarian->Type = LinkerType::GNU;
Librarian->file = "d:/dev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ar.exe";
Librarian->Extension = s.Settings.TargetOS.getStaticLibraryExtension();
s.registerProgram("org.gnu.binutils.ar", Librarian);
}
{
NativeLinkerOptions LOpts;
LOpts.System.LinkLibraries.push_back("c++");
//LOpts.System.LinkLibraries.push_back("c++fs");
auto Linker = std::make_shared<GNULinker>();
Linker->Type = LinkerType::GNU;
Linker->file = "d:/dev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android28-clang.cmd";
Linker->use_start_end_groups = false;
*Linker = LOpts;
s.registerProgram("org.LLVM.clang.ld", Linker);
}
NativeCompilerOptions COpts;
// ASM
/*{
auto L = std::make_shared<NativeLanguage>();
L->CompiledExtensions = { ".s", ".S" };
auto C = std::make_shared<GNUASMCompiler>();
C->Type = CompilerType::GNU;
C->file = "x86_64-apple-darwin15-as";
*C = COpts;
L->compiler = C;
s.registerProgramAndLanguage("org.gnu.gcc.as", C, L);
}*/
// C
{
auto L = std::make_shared<NativeLanguage>();
L->CompiledExtensions = { ".c" };
auto C = std::make_shared<GNUCompiler>();
C->Type = CompilerType::GNU;
C->file = "d:/dev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe";
*C = COpts;
L->compiler = C;
s.registerProgramAndLanguage("org.LLVM.clang", C, L);
auto cmd = C->createCommand();
cmd->args.push_back("-fno-addrsig");
}
// CPP
{
auto L = std::make_shared<NativeLanguage>();
L->CompiledExtensions = sw::getCppSourceFileExtensions();
auto C = std::make_shared<GNUCompiler>();
C->Type = CompilerType::GNU;
C->file = "d:/dev/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe";
*C = COpts;
L->compiler = C;
s.registerProgramAndLanguage("org.LLVM.clangpp", C, L);
auto cmd = C->createCommand();
cmd->args.push_back("-fno-addrsig");
cmd->args.push_back("-stdlib=libc++");
}
}
}