From 01cef12325af36e6d53cf1203f19774aa9e6555f Mon Sep 17 00:00:00 2001 From: Tilen Majerle Date: Sun, 31 Jul 2022 21:11:10 +0200 Subject: [PATCH] Add quick build-all script --- examples/win32/build_all_examples.py | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 examples/win32/build_all_examples.py diff --git a/examples/win32/build_all_examples.py b/examples/win32/build_all_examples.py new file mode 100644 index 0000000..9bc1747 --- /dev/null +++ b/examples/win32/build_all_examples.py @@ -0,0 +1,42 @@ +import os +import re + +# Get presets from the path +# Use cmake command line to list actual presets visible to cmake +def get_presets(): + presets = [] + resp = os.popen("cmake --list-presets").read().strip() + for line in resp.split("\n"): + l = line.strip() + r = re.findall("\"(.*)\"", l) + if r: + presets.append(r[0]) + return presets + +# Main execution +if __name__ == '__main__': + # Get all presets + failed = [] + presets = get_presets() + for preset in presets: + print("-------------------------------") + print("Configuring preset " + preset) + print("-------------------------------") + ret = os.system("cmake --preset " + preset) + if ret != 0: + print("!!!! Command failed !!!! with result code: " + str(ret)) + failed.append(preset) + print("Return: " + str(ret)) + print("-------------------------------") + print("Building preset " + preset) + print("-------------------------------") + ret = os.system("cmake --build --preset " + preset) + if ret != 0: + print("!!!! Command failed !!!! with result code: " + str(ret)) + failed.append(preset) + print("Return: " + str(ret)) + print("-------------------------------") + print("Failed presets:") + for p in failed: + print(p) + print("-------------------------------") \ No newline at end of file