Merge pull request #688 from kiwix/fix_build_dir

This commit is contained in:
Matthieu Gautier 2024-04-12 10:28:50 +02:00 committed by GitHub
commit 145d981328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -154,7 +154,7 @@ def main():
options = parse_args()
options.working_dir = os.path.abspath(options.working_dir)
_global.set_options(options)
neutralEnv = buildenv.NeutralEnv()
neutralEnv = buildenv.NeutralEnv(options.get_build_dir)
_global.set_neutralEnv(neutralEnv)
if options.config == "flatpak":
builder = FlatpakBuilder()

View File

@ -8,7 +8,7 @@ from ._global import neutralEnv, option
class NeutralEnv:
def __init__(self):
def __init__(self, dummy_run):
self.working_dir = option("working_dir")
self.source_dir = pj(self.working_dir, "SOURCE")
self.archive_dir = pj(self.working_dir, "ARCHIVE")
@ -17,6 +17,10 @@ class NeutralEnv:
for d in (self.source_dir, self.archive_dir, self.toolchain_dir, self.log_dir):
os.makedirs(d, exist_ok=True)
self.detect_platform()
if dummy_run:
# If this is for a dummy run, we will not run anything.
# To check for command (and so, don't enforce their presence)
return
self.ninja_command = self._detect_command(
"ninja", default=[["ninja"], ["ninja-build"]]
)