From 9fc878878036031645bbdbd5cdde3692702dbe92 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Fri, 13 Dec 2024 19:04:18 +0000 Subject: [PATCH] Use Ninja as the build system if available (not only on Windows). --- utils/python/codal_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/python/codal_utils.py b/utils/python/codal_utils.py index 636f3a85..2466a93d 100644 --- a/utils/python/codal_utils.py +++ b/utils/python/codal_utils.py @@ -1,13 +1,9 @@ import os import sys -import optparse import platform import json import shutil import re - -import os, re, json, xml.etree.ElementTree -from optparse import OptionParser import subprocess @@ -16,7 +12,10 @@ def system(cmd): sys.exit(1) def build(clean, verbose = False, parallelism = 10): - if platform.system() == "Windows": + # Use Ninja on Windows, or if available in any other OS + use_ninja = shutil.which("ninja") is not None or platform.system() == "Windows" + + if use_ninja: # configure system("cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G \"Ninja\"")