-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathwin2macos.cpp
More file actions
94 lines (80 loc) · 3.31 KB
/
Copy pathwin2macos.cpp
File metadata and controls
94 lines (80 loc) · 3.31 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
void configure(Solution &b)
{
auto &s = b.addCustomSolution();
s.Settings.TargetOS.Type = OSType::Macos;
s.Settings.Native.CompilerType = CompilerType::Clang;
{
{
auto Librarian = std::make_shared<GNULibrarian>();
Librarian->Type = LinkerType::GNU;
Librarian->file = "llvm-ar";
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 = "clang";
Linker->use_start_end_groups = false;
*Linker = LOpts;
s.registerProgram("org.LLVM.clang.ld", Linker);
auto cmd = Linker->createCommand();
cmd->args.push_back("-target");
cmd->args.push_back("x86_64-apple-macosx10.14.0");
cmd->args.push_back("-isysroot");
cmd->args.push_back("d:/dev/cygwin64/home/egorp/osxcross/target/SDK/MacOSX10.14.sdk");
cmd->args.push_back("-Wl,-sdk_version");
cmd->args.push_back("-Wl,10.14");
cmd->args.push_back("-fuse-ld=lld");
}
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 = "clang";
*C = COpts;
L->compiler = C;
s.registerProgramAndLanguage("org.LLVM.clang", C, L);
auto cmd = C->createCommand();
cmd->args.push_back("-target");
cmd->args.push_back("x86_64-apple-macosx10.14.0");
cmd->args.push_back("-isysroot");
cmd->args.push_back("d:/dev/cygwin64/home/egorp/osxcross/target/SDK/MacOSX10.14.sdk");
}
// CPP
{
auto L = std::make_shared<NativeLanguage>();
L->CompiledExtensions = getCppSourceFileExtensions();
auto C = std::make_shared<GNUCompiler>();
C->Type = CompilerType::GNU;
C->file = "clang++";
*C = COpts;
L->compiler = C;
s.registerProgramAndLanguage("org.LLVM.clangpp", C, L);
auto cmd = C->createCommand();
cmd->args.push_back("-target");
cmd->args.push_back("x86_64-apple-macosx10.14.0");
cmd->args.push_back("-isysroot");
cmd->args.push_back("d:/dev/cygwin64/home/egorp/osxcross/target/SDK/MacOSX10.14.sdk");
cmd->args.push_back("-cxx-isystem");
cmd->args.push_back("d:/dev/cygwin64/home/egorp/osxcross/target/SDK/c++/v1");
}
}
}