diff --git a/autoninja.py b/autoninja.py index 5aad538e3..9ccdfa0c6 100755 --- a/autoninja.py +++ b/autoninja.py @@ -82,14 +82,15 @@ elif os.path.exists(os.path.join(output_dir, 'rules.ninja')): use_goma = True break -# If GOMA_DISABLED is set (to anything) then gomacc will use the local -# compiler instead of doing a goma compile. This is convenient if you want -# to briefly disable goma. It avoids having to rebuild the world when -# transitioning between goma/non-goma builds. However, it is not as fast as -# doing a "normal" non-goma build because an extra process is created for each -# compile step. Checking this environment variable ensures that autoninja uses -# an appropriate -j value in this situation. -if 'GOMA_DISABLED' in os.environ: +# If GOMA_DISABLED is set to "true", "t", "yes", "y", or "1" (case-insensitive) +# then gomacc will use the local compiler instead of doing a goma compile. This +# is convenient if you want to briefly disable goma. It avoids having to rebuild +# the world when transitioning between goma/non-goma builds. However, it is not +# as fast as doing a "normal" non-goma build because an extra process is created +# for each compile step. Checking this environment variable ensures that +# autoninja uses an appropriate -j value in this situation. +goma_disabled_env = os.environ.get('GOMA_DISABLED', '0').lower() +if goma_disabled_env in ['true', 't', 'yes', 'y', '1']: use_goma = False # Specify ninja.exe on Windows so that ninja.bat can call autoninja and not