Skip to content

Commit 5b57348

Browse files
committed
Improve single file build output handling
1 parent 9d3f531 commit 5b57348

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/commands/BuildCommand.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,13 +1591,6 @@ namespace vix::commands::BuildCommand
15911591
return 1;
15921592
}
15931593

1594-
// Default behavior: if building a single file and no output option is provided,
1595-
// fallback to --bin automatically.
1596-
if (!opt_.exportBin && opt_.outPath.empty())
1597-
{
1598-
opt_.exportBin = true;
1599-
}
1600-
16011594
run_detail::Options runOpt{};
16021595
runOpt.singleCpp = true;
16031596
runOpt.cppFile = fs::absolute(opt_.cppFile);
@@ -1639,10 +1632,15 @@ namespace vix::commands::BuildCommand
16391632
}
16401633

16411634
fs::path dest;
1642-
if (opt_.exportBin)
1643-
dest = fs::current_path() / exePath.filename();
1644-
else
1635+
1636+
if (!opt_.outPath.empty())
1637+
{
16451638
dest = fs::absolute(fs::path(opt_.outPath));
1639+
}
1640+
else
1641+
{
1642+
dest = fs::current_path() / exePath.filename();
1643+
}
16461644

16471645
return export_built_binary(exePath, dest, opt_.quiet) ? 0 : 1;
16481646
}

0 commit comments

Comments
 (0)