1010import os
1111import sys
1212import re
13+ import platform
1314import subprocess
1415import multiprocessing
1516from 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