Skip to content

Commit

Permalink
fix: add required '=' due to latest cppfront change
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Oct 6, 2024
1 parent e15dcde commit f22c266
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main.cpp2
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ ensure_dir: (dir: fs::path) = {
}
}

modules_dir: () modules_dir(fs::current_path());
modules_dir: () = modules_dir(fs::current_path());
modules_dir: (base: fs::path) -> fs::path = {
return base / ".cache" / "cpp2" / "mod";
}

binaries_dir: () binaries_dir(fs::current_path());
binaries_dir: () = binaries_dir(fs::current_path());
binaries_dir: (base: fs::path) -> fs::path = {
return base / ".cache" / "cpp2" / "bin";
}

find_closest_file: (filename) find_closest_file(filename, fs::current_path());
find_closest_file: (filename) = find_closest_file(filename, fs::current_path());
find_closest_file: (filename, base: fs::path) -> std::optional<fs::path> = {
if fs::exists(base / filename) {
return base / filename;
Expand Down Expand Up @@ -267,7 +267,7 @@ build_cpp1_module: (name: std::string, sources, module_deps) = {
cwd := fs::current_path();
fs::current_path(d);
duration: std::chrono::milliseconds;
exit_code := measure(:() std::system(cmd_str$.c_str()), out duration);
exit_code := measure(:()=std::system(cmd_str$.c_str()), out duration);
fs::current_path(cwd);

log_info("compile module {} ({}ms)", name, duration.count());
Expand Down Expand Up @@ -456,7 +456,7 @@ transpile_cpp2: (src: fs::path, out_dir: fs::path) -> transpile_cpp2_result = {
ensure_dir(result.cpp1_output.parent_path());

result.cppfront_exit_code = measure(
:() std::system(cmd_str$.c_str()),
:()=std::system(cmd_str$.c_str()),
out result.duration,
);

Expand Down Expand Up @@ -622,7 +622,7 @@ build_binary: (info: cpp2b_source_binary_info) -> build_binary_result = {

result: build_binary_result = ();
result.outpath = bin_outpath;
result.exit_code = measure(:() std::system(cmd_str$.c_str()), out result.duration);
result.exit_code = measure(:()=std::system(cmd_str$.c_str()), out result.duration);
result.log_path = log_path;
return result;
}
Expand All @@ -642,7 +642,7 @@ cpp2b_detail_build_binary_name: (

bin := std::ranges::find_if(
impl*.bins*,
:(bin) fs::absolute(bin.src).replace_extension("") == fs::absolute(p$).replace_extension(""),
:(bin)=fs::absolute(bin.src).replace_extension("") == fs::absolute(p$).replace_extension(""),
);
if bin == impl*.bins*..end() {
log_warning("cannot name unknown binary target {}", p.generic_string());
Expand Down Expand Up @@ -714,7 +714,7 @@ build_build_script: (info: cpp2b_source_build_info) -> build_binary_result = {

result: build_binary_result = ();
result.outpath = bin_outpath;
result.exit_code = measure(:() std::system(cmd_str$.c_str()), out result.duration);
result.exit_code = measure(:()=std::system(cmd_str$.c_str()), out result.duration);
result.log_path = log_path;
return result;
}
Expand Down

0 comments on commit f22c266

Please sign in to comment.