Skip to content

Commit

Permalink
Remove per input_setting_pair building.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Mar 20, 2024
1 parent e78e441 commit 954b55b
Showing 1 changed file with 19 additions and 39 deletions.
58 changes: 19 additions & 39 deletions src/sw/client/common/command/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,45 +118,6 @@ SUBCOMMAND_DECL(build)
return;
}

// for ide use slightly different building
// one input per call
if (1
&& !getOptions().options_build.ide_fast_path.empty()
&& !getOptions().options_build.ide_copy_to_dir.empty()
&& !getOptions().input_settings_pairs.empty()) {
FilesSorted fast_path_files;
Strings s;
for (auto &&p : getOptions().input_settings_pairs)
{
s.push_back(p);
if (s.size() == 2)
{
LOG_INFO(logger, "Building " << s[0]);
auto b = createBuild({getInputs(), s});
b->build();
fast_path_files.merge(b->fast_path_files);
s.clear();
}
}
{
String s;
for (auto &f : fast_path_files)
s += to_string(normalize_path(f)) + "\n";
write_file(getOptions().options_build.ide_fast_path, s);

uint64_t mtime = 0;
for (auto &f : fast_path_files)
{
auto lwt = fs::last_write_time(f);
mtime ^= file_time_type2time_t(lwt);
}
path fmtime = getOptions().options_build.ide_fast_path;
fmtime += ".t";
write_file(fmtime, std::to_string(mtime));
}
return;
}

// defaults or only one of build_arg and -S specified
// -S == build_arg
// -B == fs::current_path()
Expand All @@ -177,4 +138,23 @@ SUBCOMMAND_DECL(build)
return;
}
b->build();

// handle ide_fast_path
if (!getOptions().options_build.ide_fast_path.empty()) {
String s;
for (auto &f : b->fast_path_files)
s += to_string(normalize_path(f)) + "\n";
write_file(getOptions().options_build.ide_fast_path, s);

uint64_t mtime = 0;
for (auto &f : b->fast_path_files)
{
auto lwt = fs::last_write_time(f);
mtime ^= file_time_type2time_t(lwt);
}
path fmtime = getOptions().options_build.ide_fast_path;
fmtime += ".t";
write_file(fmtime, std::to_string(mtime));
return;
}
}

0 comments on commit 954b55b

Please sign in to comment.