Skip to content

Commit 4dc1532

Browse files
committed
Remove some usages of SW_BINARY_DIR.
1 parent ddc5524 commit 4dc1532

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/sw/client/cli/command/build.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ extern ::cl::opt<bool> build_after_fetch;
3333

3434
static ::cl::list<String> build_arg(::cl::Positional, ::cl::desc("Files or directories to build (paths to config)"), ::cl::sub(subcommand_build));
3535

36-
static ::cl::opt<String> build_source_dir("S", ::cl::desc("Explicitly specify a source directory."), ::cl::sub(subcommand_build), ::cl::init("."));
37-
static ::cl::opt<String> build_binary_dir("B", ::cl::desc("Explicitly specify a build directory."), ::cl::sub(subcommand_build), ::cl::init(SW_BINARY_DIR));
36+
//static ::cl::opt<String> build_source_dir("S", ::cl::desc("Explicitly specify a source directory."), ::cl::sub(subcommand_build), ::cl::init("."));
37+
//static ::cl::opt<String> build_binary_dir("B", ::cl::desc("Explicitly specify a build directory."), ::cl::sub(subcommand_build), ::cl::init(SW_BINARY_DIR));
3838

3939
static ::cl::opt<bool> build_fetch("fetch", ::cl::desc("Fetch sources, then build"), ::cl::sub(subcommand_build));
4040
static ::cl::opt<path> build_explan("ef", ::cl::desc("Build execution plan from specified file"), ::cl::sub(subcommand_build));
@@ -606,7 +606,7 @@ static void isolated_build1(sw::SwContext &swctx)
606606
LOG_INFO(logger, "Copying files");
607607

608608
auto m = getPackages(b, srcs);
609-
auto d = fs::current_path() / SW_BINARY_DIR / "isolated";
609+
auto d = b.getBuildDirectory() / "isolated";
610610

611611
for (const auto &[pkg, tgts] : b.getTargetsToBuild())
612612
{

src/sw/client/cli/command/fetch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static sw::SourceDirMap getSources(sw::SwContext &swctx)
5454
b.loadInputs();
5555
b.setTargetsToBuild();
5656

57-
auto d = fs::current_path() / SW_BINARY_DIR / "src";
57+
auto d = b.getBuildDirectory() / "src";
5858

5959
sw::SourceDirMap srcs;
6060
std::unordered_set<sw::SourcePtr> sources;
@@ -73,7 +73,7 @@ static sw::SourceDirMap getSources(sw::SwContext &swctx)
7373
}
7474

7575
sw::SourceDownloadOptions opts;
76-
opts.root_dir = fs::current_path() / SW_BINARY_DIR;
76+
opts.root_dir = b.getBuildDirectory();
7777
opts.ignore_existing_dirs = true;
7878
opts.existing_dirs_age = std::chrono::hours(1);
7979

src/sw/client/cli/command/upload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ SUBCOMMAND_DECL2(upload)
131131
// dbg purposes
132132
for (auto &[id, d] : m)
133133
{
134-
write_file(fs::current_path() / SW_BINARY_DIR / "upload" / id.toString() += ".json", d->getString());
134+
write_file(b->getBuildDirectory() / "upload" / id.toString() += ".json", d->getString());
135135
auto id2 = sw::PackageId(sw::PackagePath(upload_prefix) / id.getPath(), id.getVersion());
136136
LOG_INFO(logger, "Uploading " + id2.toString());
137137
}

src/sw/client/cli/generator/generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ std::unique_ptr<Generator> Generator::create(const String &s)
253253

254254
path Generator::getRootDirectory(const sw::SwBuild &b) const
255255
{
256-
return fs::current_path() / path(SW_BINARY_DIR) / "g" / getPathString() / b.getHash();
256+
return b.getBuildDirectory() / "g" / getPathString() / b.getHash();
257257
}
258258

259259
path Generator::getPathString() const

src/sw/driver/entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ void PrepareConfigEntryPoint::many2one(Build &b, const std::unordered_set<LocalP
495495
if (is_under_root(fn, b.getContext().getLocalStorage().storage_dir_pkg))
496496
h = fn.parent_path().parent_path() / "auxl" / ("defs" + hash + ".h");
497497
else
498-
h = fn.parent_path() / SW_BINARY_DIR / "auxl" / ("defs" + hash + ".h");
498+
h = b.getMainBuild().getBuildDirectory() / "auxl" / ("defs" + hash + ".h");
499499
primitives::CppEmitter ctx;
500500

501501
ctx.addLine("#define configure configure" + hash);

0 commit comments

Comments
 (0)