Skip to content

Commit

Permalink
Add ability to not create the .scons-option-cache file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentarctagon authored and jyrkive committed Nov 8, 2017
1 parent f1749c8 commit ad3b3d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SConstruct
Expand Up @@ -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()
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ad3b3d8

Please sign in to comment.