Skip to content

Commit

Permalink
chore: add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Aug 10, 2024
1 parent 7089661 commit 637b1b6
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/main.cpp2
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ get_libcxx_build_root: () -> fs::path = {
return getenv_sv("CPP2B_LIBCXX_BUILD_ROOT").expect("missing 'CPP2B_LIBCXX_BUILD_ROOT' environment variable");
}

get_system_modules_dir: () -> fs::path = {
compiler :== cpp2b::compiler();
get_system_modules_dir: (compiler: cpp2b::compiler_type) -> fs::path = {
if compiler == cpp2b::compiler_type::msvc { return get_vs_tools_dir() / "modules"; }
if compiler == cpp2b::compiler_type::clang { return get_libcxx_build_root() / "modules"; }
log_error("cannot find system cpp20 modules directory");
Expand All @@ -197,7 +196,7 @@ ensure_system_module: (name: std::string) = {
ensure_system_module: (name: std::string, deps) = {
d := modules_dir();
bmi := d / std::format("{}{}", name, bmi_extension(cpp2b::compiler()));
system_modules_dir := get_system_modules_dir();
system_modules_dir := get_system_modules_dir(cpp2b::compiler());

if !fs::exists(bmi) {
build_cpp1_module(
Expand All @@ -214,6 +213,11 @@ ensure_std_modules: () = {
}

build_cpp1_module: (name: std::string, sources, module_deps) = {
if cpp2b::compiler() != cpp2b::compiler_type::msvc {
log_error("TODO: build_cpp1_module non-msvc support");
std::abort();
}

d := fs::absolute(modules_dir());
bmi := d / ("(name)$.ifc");
cmd_str: std::string = "cl /nologo /std:c++latest /W4 /MDd /EHsc /c /interface /TP";
Expand Down Expand Up @@ -496,6 +500,11 @@ build_binary: (info: cpp2b_source_binary_info) -> build_binary_result = {
ensure_dir(log_path.parent_path());
ensure_dir(bin_outpath.parent_path());

if cpp2b::compiler() != cpp2b::compiler_type::msvc {
log_error("TODO: build_binary non-msvc support");
std::abort();
}

d := fs::absolute(modules_dir());
cmd_str: std::string = "cl /nologo /std:c++latest /W4 /MDd /EHsc /DEBUG:full /Zi /FC";
for info.imports do (imp: std::string) {
Expand Down Expand Up @@ -548,6 +557,11 @@ build_build_script: (info: cpp2b_source_build_info) -> build_binary_result = {
ensure_dir(log_path.parent_path());
ensure_dir(bin_outpath.parent_path());

if cpp2b::compiler() != cpp2b::compiler_type::msvc {
log_error("TODO: build_build_script non-msvc support");
std::abort();
}

d := fs::absolute(modules_dir());
cmd_str: std::string = "cl /nologo /std:c++latest /W4 /MDd /EHsc /LDd /DLL";
for info.imports do (imp: std::string) {
Expand Down

0 comments on commit 637b1b6

Please sign in to comment.