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"])