Skip to content

Commit 9fc8788

Browse files
Use Ninja as the build system if available (not only on Windows).
1 parent 14f2f7b commit 9fc8788

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

utils/python/codal_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import os
22
import sys
3-
import optparse
43
import platform
54
import json
65
import shutil
76
import re
8-
9-
import os, re, json, xml.etree.ElementTree
10-
from optparse import OptionParser
117
import subprocess
128

139

@@ -16,7 +12,10 @@ def system(cmd):
1612
sys.exit(1)
1713

1814
def build(clean, verbose = False, parallelism = 10):
19-
if platform.system() == "Windows":
15+
# Use Ninja on Windows, or if available in any other OS
16+
use_ninja = shutil.which("ninja") is not None or platform.system() == "Windows"
17+
18+
if use_ninja:
2019
# configure
2120
system("cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G \"Ninja\"")
2221

0 commit comments

Comments
 (0)