diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2017-12-14 16:15:06 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2017-12-14 16:44:45 +0200 |
commit | f8303ec6fb94ad15dcfdef59c315eef609768734 (patch) | |
tree | a3deef2435bdfdc47f68419d66bae00d7a1c2bf3 /platform/osx | |
parent | f3ad14224e27f2a25196575e3c43ebc792c90894 (diff) |
Adds `macports_clang` build flag to build using clang-5.0 form MacPorts (with OpenMP support).
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/SCsub | 6 | ||||
-rw-r--r-- | platform/osx/detect.py | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/platform/osx/SCsub b/platform/osx/SCsub index cb88bc470a..13ce14f040 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -4,7 +4,11 @@ import os Import('env') def make_debug(target, source, env): - os.system('dsymutil %s -o %s.dSYM' % (target[0], target[0])) + if (env["macports_clang"]): + mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local") + os.system(mpprefix + '/libexec/llvm-5.0/bin/llvm-dsymutil %s -o %s.dSYM' % (target[0], target[0])) + else: + os.system('dsymutil %s -o %s.dSYM' % (target[0], target[0])) files = [ 'crash_handler_osx.mm', diff --git a/platform/osx/detect.py b/platform/osx/detect.py index ff7cf2ad2f..77a4ee1a48 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -72,6 +72,19 @@ def configure(env): else: # 64-bit, default env.Append(CCFLAGS=['-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'x86_64']) + if (env["macports_clang"]): + mpprefix = os.environ.get("MACPORTS_PREFIX", "/opt/local") + env["CC"] = mpprefix + "/libexec/llvm-5.0/bin/clang" + env["LD"] = mpprefix + "/libexec/llvm-5.0/bin/clang++" + env["CXX"] = mpprefix + "/libexec/llvm-5.0/bin/clang++" + env['AR'] = mpprefix + "/libexec/llvm-5.0/bin/llvm-ar" + env['RANLIB'] = mpprefix + "/libexec/llvm-5.0/bin/llvm-ranlib" + env['AS'] = mpprefix + "/libexec/llvm-5.0/bin/llvm-as" + env.Append(CCFLAGS=['-D__MACPORTS__']) #hack to fix libvpx MM256_BROADCASTSI128_SI256 define + if (env["openmp"]): + env.Append(CPPFLAGS=['-fopenmp']) + env.Append(LINKFLAGS=['-L' + mpprefix + '/lib/libomp/']) + env.Append(LIBS=['gomp']) else: # osxcross build root = os.environ.get("OSXCROSS_ROOT", 0) |