diff options
-rw-r--r-- | openmp/runtime/test/lit.cfg | 11 |
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")) |