Skip to content

Commit 7ce65f5

Browse files
committed
Merge pull request #95504 from mihe/ninja-options
Expose more Ninja-related build options
2 parents c5eacb8 + a387c26 commit 7ce65f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

SConstruct

+4-5
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ opts.Add(BoolVariable("dev_mode", "Alias for dev options: verbose=yes warnings=e
234234
opts.Add(BoolVariable("tests", "Build the unit tests", False))
235235
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False))
236236
opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False))
237+
opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True))
238+
opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja")
237239
opts.Add(BoolVariable("compiledb", "Generate compilation DB (`compile_commands.json`) for external tools", False))
238240
opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False))
239241
opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True))
@@ -1031,13 +1033,10 @@ if env["ninja"]:
10311033
Exit(255)
10321034

10331035
SetOption("experimental", "ninja")
1036+
env["NINJA_FILE_NAME"] = env["ninja_file"]
1037+
env["NINJA_DISABLE_AUTO_RUN"] = not env["ninja_auto_run"]
10341038
env.Tool("ninja")
10351039

1036-
# By setting this we allow the user to run ninja by themselves with all
1037-
# the flags they need, as apparently automatically running from scons
1038-
# is way slower.
1039-
SetOption("disable_execute_ninja", True)
1040-
10411040
# Threads
10421041
if env["threads"]:
10431042
env.Append(CPPDEFINES=["THREADS_ENABLED"])

0 commit comments

Comments
 (0)