From 78889bdd2b6c6180483d97e5fa220aa660f23a03 Mon Sep 17 00:00:00 2001 From: Alexander Neben Date: Tue, 24 May 2022 21:55:23 +0000 Subject: SERVER-66384 Ninja shared build log and common output directory (cherry picked from commit 55ef8e5a8f084a68efa3e8ba148fb77d72117c49) --- SConstruct | 9 ++++++--- etc/scons/experimental_unified_ninja.vars | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 etc/scons/experimental_unified_ninja.vars diff --git a/SConstruct b/SConstruct index 06037bd1791..539bd768190 100644 --- a/SConstruct +++ b/SConstruct @@ -2,7 +2,6 @@ import atexit import copy -import datetime import errno import json import os @@ -953,6 +952,11 @@ env_vars.Add('MSVC_VERSION', help='Sets the version of Visual C++ to use (e.g. 14.2 for VS2019, 14.3 for VS2022)', default="14.3") +env_vars.Add('NINJA_BUILDDIR', + help="Location for shared Ninja state", + default="$BUILD_DIR/ninja", +) + env_vars.Add('NINJA_PREFIX', default="build", help="""A prefix to add to the beginning of generated ninja @@ -1198,7 +1202,6 @@ envDict = dict(BUILD_ROOT=buildDir, LIBDEPS_TAG_EXPANSIONS=[], ) - # By default, we will get the normal SCons tool search. But if the # user has opted into the next gen tools, add our experimental tool # directory into the default toolpath, ahead of whatever is already in @@ -4626,7 +4629,7 @@ if get_option('ninja') != 'disabled': env.FatalError("Use of ccache is mandatory with --ninja and icecream older than 1.2. You are running {}.".format(env['ICECREAM_VERSION'])) ninja_builder = Tool("ninja") - env["NINJA_BUILDDIR"] = env.Dir("$BUILD_DIR/ninja") + env["NINJA_BUILDDIR"] = env.Dir("$NINJA_BUILDDIR") ninja_builder.generate(env) ninjaConf = Configure(env, help=False, custom_tests = { diff --git a/etc/scons/experimental_unified_ninja.vars b/etc/scons/experimental_unified_ninja.vars new file mode 100644 index 00000000000..21e03e71296 --- /dev/null +++ b/etc/scons/experimental_unified_ninja.vars @@ -0,0 +1,6 @@ +# Configures the build for building with a unified ninja +# Each configuration will share a ninja log +# This allows the output binaries of each configuration to share a common directory + +NINJA_BUILDDIR="$BUILD_ROOT/ninja" +DESTDIR="$BUILD_ROOT/install" -- cgit v1.2.1