Skip to content

Commit

Permalink
[tools] Overwrite :target for Linux examples on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Aug 1, 2019
1 parent 5284e79 commit 61737f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/scripts/examples_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import sys
import re
import platform
import subprocess
import multiprocessing
from pathlib import Path
Expand All @@ -35,6 +36,9 @@ def generate(project):
path = project.parent
output = ["=" * 90, "Generating: {}".format(path)]
options = " ".join("-D{}={}".format(k, v) for k,v in global_options.items())
# Compile Linux examples under macOS with hosted-darwin target
if "Darwin" in platform.platform() and "hosted-linux" in project.read_text():
options += " -D:target=hosted-darwin"
rc, ro = run(path, "lbuild {} build".format(options))
print("\n".join(output + [ro]))
return None if rc else project
Expand All @@ -46,11 +50,12 @@ def build(project):
if ":build:scons" in project_cfg:
commands.append("python3 `which scons` build --cache-show --random")
if ":build:cmake" in project_cfg:
commands.append("make")
commands.append("make cmake && make build-release")

rcs = 0
for command in commands:
output = ["=" * 90, "Building: {} with {}".format(path, "SCons" if "scons" in command else "CMake")]
output = ["=" * 90, "Building: {} with {}".format(
path, "SCons" if "scons" in command else "CMake")]
rc, ro = run(path, command)
rcs += rc
print("\n".join(output + [ro]))
Expand Down

0 comments on commit 61737f1

Please sign in to comment.