diff --git a/tools/make.py b/tools/make.py index 5ac2f0f367..1e03725e98 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1302,10 +1302,11 @@ See the make.cfg file for additional build options. addonTomlPath = os.path.join(work_drive, prefix, module, "addon.toml") if os.path.isfile(addonTomlPath): with open(addonTomlPath, "r") as f: - if "preprocess = false" in f.read(): + tomlFile = f.read() + if "preprocess = false" in tomlFile: print_error("'preprocess = false' not supported") raise - skipPreprocessing = "[preprocess]\nenabled = false" in f.read() + skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") diff --git a/tools/sqfvmChecker.py b/tools/sqfvmChecker.py index 6a85c9e5db..444b6e9026 100644 --- a/tools/sqfvmChecker.py +++ b/tools/sqfvmChecker.py @@ -29,17 +29,19 @@ def get_files_to_process(basePath): addonTomlPath = os.path.join(root, "addon.toml") if os.path.isfile(addonTomlPath): with open(addonTomlPath, "r") as f: - if "preprocess = false" in f.read(): + tomlFile = f.read() + if "preprocess = false" in tomlFile: print("'preprocess = false' not supported") raise - skipPreprocessing = "[preprocess]\nenabled = false" in f.read() + skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile addonTomlPath = os.path.join(os.path.dirname(root), "addon.toml") if os.path.isfile(addonTomlPath): with open(addonTomlPath, "r") as f: - if "preprocess = false" in f.read(): + tomlFile = f.read() + if "preprocess = false" in tomlFile: print("'preprocess = false' not supported") raise - skipPreprocessing = "[preprocess]\nenabled = false" in f.read() + skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile if file == "config.cpp" and skipPreprocessing: continue # ignore configs with __has_include filePath = os.path.join(root, file)