Merge pull request #95504 from mihe/ninja-options

Expose more Ninja-related build options
This commit is contained in:
Rémi Verschelde 2024-08-26 23:28:55 +02:00
commit 7ce65f54be
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -234,6 +234,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("tests", "Build the unit tests", False))
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", 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", "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("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("verbose", "Enable verbose output for the compilation", False))
opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True)) opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True))
@ -1031,13 +1033,10 @@ if env["ninja"]:
Exit(255) Exit(255)
SetOption("experimental", "ninja") SetOption("experimental", "ninja")
env["NINJA_FILE_NAME"] = env["ninja_file"]
env["NINJA_DISABLE_AUTO_RUN"] = not env["ninja_auto_run"]
env.Tool("ninja") 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 # Threads
if env["threads"]: if env["threads"]:
env.Append(CPPDEFINES=["THREADS_ENABLED"]) env.Append(CPPDEFINES=["THREADS_ENABLED"])