refactor: route an executable's outputs through ProgramDir()

Build() put an executable and the files it reads at run time (its
shaders, cfg.files, assets, and what its dependencies forward to it) in
BinDir() directly, and ExpectedOutput(), -r and the wasm variant copies
each spelled the same directory again. A Flatpak keeps its program in
files/bin of the build directory instead, so those places now ask
Configuration::ProgramDir(), which for every configuration is still its
bin dir. Nothing moves yet.
This commit is contained in:
Jorijn van der Graaf 2026-11-01 18:47:01 +01:00
commit 5a63dd81b8
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 15 additions and 7 deletions

View file

@ -660,6 +660,12 @@ export namespace Crafter {
}
fs::path BuildDir() const { return path / "build" / VariantId(); }
fs::path BinDir() const { return path / "bin" / VariantId(); }
// Where an executable and the files it reads at run time land, and
// the directory `-r` runs a host executable in and serves a browser
// build from: its shaders, cfg.files and assets, and those its
// dependencies forward to it. For now that is the bin
// dir of every configuration.
fs::path ProgramDir() const { return BinDir(); }
fs::path PcmDir() const {
return type == ConfigurationType::Executable ? BuildDir() : BinDir();
}