Skip to content

Commit d839c00

Browse files
committed
[tools] Overwrite :target for Linux examples on macOS
1 parent f9b6ca5 commit d839c00

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tools/scripts/examples_compile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import sys
1212
import re
13+
import platform
1314
import subprocess
1415
import multiprocessing
1516
from pathlib import Path
@@ -35,6 +36,9 @@ def generate(project):
3536
path = project.parent
3637
output = ["=" * 90, "Generating: {}".format(path)]
3738
options = " ".join("-D{}={}".format(k, v) for k,v in global_options.items())
39+
# Compile Linux examples under macOS with hosted-darwin target
40+
if "Darwin" in platform.platform() and "hosted-linux" in project.read_text():
41+
options += " -D:target=hosted-darwin"
3842
rc, ro = run(path, "lbuild {} build".format(options))
3943
print("\n".join(output + [ro]))
4044
return None if rc else project
@@ -46,11 +50,12 @@ def build(project):
4650
if ":build:scons" in project_cfg:
4751
commands.append("python3 `which scons` build --cache-show --random")
4852
if ":build:cmake" in project_cfg:
49-
commands.append("make")
53+
commands.append("make cmake && make build-release")
5054

5155
rcs = 0
5256
for command in commands:
53-
output = ["=" * 90, "Building: {} with {}".format(path, "SCons" if "scons" in command else "CMake")]
57+
output = ["=" * 90, "Building: {} with {}".format(
58+
path, "SCons" if "scons" in command else "CMake")]
5459
rc, ro = run(path, command)
5560
rcs += rc
5661
print("\n".join(output + [ro]))

0 commit comments

Comments
 (0)