Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit129a4b7

Browse files
authored
Updated bootstrap and buildexe (#181)
1 parentd41c6cb commit129a4b7

File tree

36 files changed

+1408
-418
lines changed

36 files changed

+1408
-418
lines changed

‎bootstrap/config/toolchain_linux_gcc.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[toolchain.custom]
1+
[toolchain.host]
22
build =true
33
test =true
44

‎bootstrap/config/toolchain_win_gcc.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[toolchain.custom]
1+
[toolchain.host]
22
build =true
33
test =true
44

5-
id ="gcc"
5+
id ="mingw"
66
name ="x86_64-w64-mingw32"
77
asm_compiler ="as"
88
c_compiler ="gcc"

‎bootstrap/config/toolchain_win_msvc.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[toolchain.custom]
1+
[toolchain.host]
22
build =true
33
test =true
44

‎bootstrap/include/bootstrap/build_tpl.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121

2222
namespacebuildcc {
2323

24-
voidtpl_cb(BaseTarget &target);
24+
structTplConfig {
25+
TplConfig() =default;
26+
27+
OsId os_id{OsId::Linux};
28+
};
29+
30+
voidtpl_cb(BaseTarget &target,const TplConfig &config = TplConfig());
2531

2632
}// namespace buildcc
2733

‎bootstrap/main.buildcc.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ static void hybrid_simple_example_cb(BaseTarget &target,
3535
intmain(int argc,char **argv) {
3636
Args args;
3737
ArgToolchain custom_toolchain_arg;
38-
args.AddToolchain("custom","Host Toolchain", custom_toolchain_arg);
38+
args.AddToolchain("host","Host Toolchain", custom_toolchain_arg);
3939
args.Parse(argc, argv);
4040

4141
Registerreg(args);
4242
reg.Clean(clean_cb);
4343

4444
BaseToolchain toolchain = custom_toolchain_arg.ConstructToolchain();
4545

46-
PersistentStorage storage;
4746
BuildBuildCCbuildcc(
4847
reg, toolchain,
4948
TargetEnv(env::get_project_root_dir(),env::get_project_build_dir()));

‎bootstrap/src/build_buildcc.cpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ void buildcc_cb(BaseTarget &target, const BaseGenerator &schema_gen,
5454
target.GlobHeaders("lib/env/include/env");
5555

5656
// TOOLCHAIN
57+
target.GlobSources("lib/toolchain/src/api");
5758
target.AddIncludeDir("lib/toolchain/include");
5859
target.GlobHeaders("lib/toolchain/include/toolchain");
60+
target.GlobHeaders("lib/toolchain/include/toolchain/api");
5961

6062
// TARGET
6163
target.GlobSources("lib/target/src/common");
@@ -238,7 +240,9 @@ void BuildBuildCC::Setup(const ArgToolchainState &state) {
238240
"tiny-process-library",
239241
env_.GetTargetBuildDir()));
240242
reg_.CallbackIf(state, global_flags_cb, tpl_lib, toolchain_);
241-
reg_.Build(state, tpl_cb, tpl_lib);
243+
TplConfig tpl_config;
244+
tpl_config.os_id =get_host_os();
245+
reg_.Build(state, tpl_cb, tpl_lib, tpl_config);
242246

243247
// TODO, Make this a generic selection between StaticTarget and
244248
// DynamicTarget

‎bootstrap/src/build_cli11.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace buildcc {
2121
voidcli11_ho_cb(TargetInfo &info) {
2222
info.AddIncludeDir("include");
2323
info.GlobHeaders("include/CLI");
24-
// TODO, Add PCH
2524
}
2625

2726
}// namespace buildcc

‎bootstrap/src/build_flatbuffers.cpp‎

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -82,45 +82,30 @@ void build_flatc_exe_cb(BaseTarget &target) {
8282
kFlatcPreprocessorFlags.cend(),
8383
[&](constauto &f) { target.AddPreprocessorFlag(f); });
8484

85-
ifconstexpr (env::is_win()) {
86-
switch (target.GetToolchain().GetId()) {
87-
case ToolchainId::Gcc:
88-
case ToolchainId::MinGW:
89-
std::for_each(kFlatcGccCppCompileFlags.cbegin(),
90-
kFlatcGccCppCompileFlags.cend(),
91-
[&](constauto &f) { target.AddCppCompileFlag(f); });
92-
break;
93-
case ToolchainId::Msvc:
94-
std::for_each(kFlatcMsvcCppCompileFlags.cbegin(),
95-
kFlatcMsvcCppCompileFlags.cend(),
96-
[&](constauto &f) { target.AddCppCompileFlag(f); });
97-
break;
98-
default:
99-
break;
100-
}
85+
switch (target.GetToolchain().GetId()) {
86+
case ToolchainId::Gcc:
87+
case ToolchainId::MinGW:
88+
std::for_each(kFlatcGccCppCompileFlags.cbegin(),
89+
kFlatcGccCppCompileFlags.cend(),
90+
[&](constauto &f) { target.AddCppCompileFlag(f); });
91+
break;
92+
case ToolchainId::Msvc:
93+
std::for_each(kFlatcMsvcCppCompileFlags.cbegin(),
94+
kFlatcMsvcCppCompileFlags.cend(),
95+
[&](constauto &f) { target.AddCppCompileFlag(f); });
96+
break;
97+
case ToolchainId::Clang:
98+
break;
99+
default:
100+
break;
101101
}
102102

103-
ifconstexpr (env::is_linux()) {
104-
switch (target.GetToolchain().GetId()) {
105-
case ToolchainId::Gcc:
106-
std::for_each(kFlatcGccCppCompileFlags.cbegin(),
107-
kFlatcGccCppCompileFlags.cend(),
108-
[&](constauto &f) { target.AddCppCompileFlag(f); });
109-
break;
110-
default:
111-
break;
112-
}
113-
}
114-
115-
// TODO, Add PCH
116-
117103
target.Build();
118104
}
119105

120106
voidflatbuffers_ho_cb(TargetInfo &info) {
121107
info.AddIncludeDir("include");
122108
info.GlobHeaders("include/flatbuffers");
123-
// TODO, Add PCH
124109
}
125110

126111
}// namespace buildcc

‎bootstrap/src/build_taskflow.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ void taskflow_ho_cb(TargetInfo &info) {
2323
info.GlobHeaders("taskflow");
2424
info.GlobHeaders("taskflow/core");
2525
info.GlobHeaders("taskflow/core/algorithm");
26-
// TODO, Track more header files
26+
info.GlobHeaders("taskflow/cuda");
27+
info.GlobHeaders("taskflow/cuda/cuda_algorithm");
28+
info.GlobHeaders("taskflow/dsl");
29+
info.GlobHeaders("taskflow/sycl");
30+
info.GlobHeaders("taskflow/sycl/sycl_algorithm");
31+
info.GlobHeaders("taskflow/utility");
2732
}
2833

2934
}// namespace buildcc

‎bootstrap/src/build_tpl.cpp‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@
1818

1919
namespacebuildcc {
2020

21-
voidtpl_cb(BaseTarget &target) {
21+
voidtpl_cb(BaseTarget &target,const TplConfig &config) {
2222
target.AddSource("process.cpp");
2323
target.AddIncludeDir("");
2424
target.AddHeader("process.hpp");
2525

26-
ifconstexpr (env::is_win()) {
26+
switch (config.os_id) {
27+
case OsId::Win:
2728
target.AddSource("process_win.cpp");
28-
}else {
29+
break;
30+
case OsId::Linux:
31+
case OsId::Unix:
32+
case OsId::Mac:
2933
target.AddSource("process_unix.cpp");
34+
break;
35+
default:
36+
break;
3037
}
3138

3239
target.Build();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp