summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-01-19 19:26:43 +0000
committerHans Wennborg <hans@hanshq.net>2016-01-19 19:26:43 +0000
commit464307ffe7f9dc417ab1c76324ba7cf2ae2a8345 (patch)
treeffb26ff80a28703805034f2e2dbc89de78323db0
parentb83a8ddfe88d5f3b4cb873a6068a3ba64e105c45 (diff)
downloadbcm5719-llvm-464307ffe7f9dc417ab1c76324ba7cf2ae2a8345.tar.gz
bcm5719-llvm-464307ffe7f9dc417ab1c76324ba7cf2ae2a8345.zip
lit.cfg: Pass -isysroot to the SDK on Darwin
Newly-built Clangs don't automatically find the SDK, and newer versions of Mac OS X don't provide it under /usr/include etc. llvm-svn: 258169
-rw-r--r--openmp/runtime/test/lit.cfg11
1 files changed, 11 insertions, 0 deletions
diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg
index 2f258eff748..e6d446757be 100644
--- a/openmp/runtime/test/lit.cfg
+++ b/openmp/runtime/test/lit.cfg
@@ -2,6 +2,7 @@
# Configuration file for the 'lit' test runner.
import os
+import subprocess
import lit.formats
# Tell pylint that we know config and lit_config exist somewhere.
@@ -57,6 +58,16 @@ if config.operating_system == 'Darwin':
if config.using_hwloc:
config.test_cflags += " -Wl,-rpath," + config.hwloc_library_dir
+# Find the SDK on Darwin
+if config.operating_system == 'Darwin':
+ cmd = subprocess.Popen(['xcrun', '--show-sdk-path'],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = cmd.communicate()
+ out = out.strip()
+ res = cmd.wait()
+ if res == 0 and out:
+ config.test_cflags += " -isysroot " + out
+
# substitutions
config.substitutions.append(("%libomp-compile-and-run", \
"%clang %cflags %s -o %t -lm && %t"))
OpenPOWER on IntegriCloud