diff --git a/code/scripts/pio_pre.py b/code/scripts/pio_pre.py index 723390d7..495f67e0 100644 --- a/code/scripts/pio_pre.py +++ b/code/scripts/pio_pre.py @@ -150,7 +150,7 @@ if len(ino) == 1 and ino[0].name == "espurna.ino": env.AddMethod(ConvertInoToCpp) # merge every .cpp into a single file and **only** build that single file -if os.environ.get("ESPURNA_BUILD_SINGLE_SOURCE"): +if "1" == os.environ.get("ESPURNA_BUILD_SINGLE_SOURCE", "0"): cpp_files = [] for root, dirs, filenames in os.walk("espurna"): for name in filenames: diff --git a/code/scripts/test_build.py b/code/scripts/test_build.py index 1587efe3..b3606af8 100755 --- a/code/scripts/test_build.py +++ b/code/scripts/test_build.py @@ -80,7 +80,8 @@ def run_configurations(args, configurations): os_env = os.environ.copy() os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = "-DUSE_CUSTOM_H" os_env["PLATFORMIO_BUILD_CACHE_DIR"] = "test/pio_cache" - os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1" + if not args.no_single_source: + os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1" start = time.time() subprocess.check_call(cmd, env=os_env) @@ -171,5 +172,8 @@ if __name__ == "__main__": parser.add_argument( "--no-silent", action="store_true", help="Do not silence pio-run" ) + parser.add_argument( + "--no-single-source", action="store_true", help="Disable 'unity' build" + ) main(parser.parse_args())