From a387c26770dc3bec627176d165fc7f31cd5eb768 Mon Sep 17 00:00:00 2001 From: Mikael Hermansson Date: Tue, 13 Aug 2024 16:30:44 +0200 Subject: [PATCH] Expose more Ninja-related build options --- SConstruct | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 0ae8f1a3872..5c070729d3e 100644 --- a/SConstruct +++ b/SConstruct @@ -233,6 +233,8 @@ opts.Add(BoolVariable("dev_mode", "Alias for dev options: verbose=yes warnings=e opts.Add(BoolVariable("tests", "Build the unit tests", False)) opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False)) opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False)) +opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True)) +opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja") opts.Add(BoolVariable("compiledb", "Generate compilation DB (`compile_commands.json`) for external tools", False)) opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False)) opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True)) @@ -1026,13 +1028,10 @@ if env["ninja"]: Exit(255) SetOption("experimental", "ninja") + env["NINJA_FILE_NAME"] = env["ninja_file"] + env["NINJA_DISABLE_AUTO_RUN"] = not env["ninja_auto_run"] env.Tool("ninja") - # By setting this we allow the user to run ninja by themselves with all - # the flags they need, as apparently automatically running from scons - # is way slower. - SetOption("disable_execute_ninja", True) - # Threads if env["threads"]: env.Append(CPPDEFINES=["THREADS_ENABLED"])