From ad3b3d8d9fcf614378305cd8b21b6e8d8bc0b134 Mon Sep 17 00:00:00 2001 From: pentarctagon Date: Sat, 4 Nov 2017 02:20:09 -0500 Subject: [PATCH] Add ability to not create the .scons-option-cache file. --- SConstruct | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index e081fc6c95bf..a0b1a3a35784 100755 --- a/SConstruct +++ b/SConstruct @@ -16,7 +16,7 @@ from os import access, F_OK # Warn user of current set of build options. AddOption('--option-cache', dest='option_cache', nargs=1, type = 'string', action = 'store', metavar = 'FILE', help='file with cached construction variables', default = '.scons-option-cache') -if os.path.exists(GetOption("option_cache")): +if GetOption("option_cache") != "" and os.path.exists(GetOption("option_cache")): optfile = open(GetOption("option_cache")) print("Saved options: {}".format(optfile.read().replace("\n", ", ")[:-2])) optfile.close() @@ -134,7 +134,8 @@ if env["lockfile"]: import atexit atexit.register(os.remove, lockfile) -opts.Save(GetOption("option_cache"), env) +if GetOption("option_cache") != "": + opts.Save(GetOption("option_cache"), env) env.SConsignFile("$build_dir/sconsign.dblite") # If OS_ENV was enabled, copy the entire OS environment.