Skip to content

Commit

Permalink
Use Ninja as the build system if available (not only on Windows).
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Dec 13, 2024
1 parent 14f2f7b commit 3ce22cf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions utils/python/codal_utils.py
Original file line number Diff line number Diff line change
@@ -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


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

def build(clean, verbose = False, parallelism = 10):
if platform.system() == "Windows":
# Use Ninja in 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\"")

Expand Down

0 comments on commit 3ce22cf

Please sign in to comment.