[Openmp-commits] [openmp] r258169 - lit.cfg: Pass -isysroot to the SDK on Darwin
Hans Wennborg via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jan 19 11:26:47 PST 2016
Author: hans
Date: Tue Jan 19 13:26:43 2016
New Revision: 258169
URL: http://llvm.org/viewvc/llvm-project?rev=258169&view=rev
Log:
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.
Modified:
openmp/trunk/runtime/test/lit.cfg
Modified: openmp/trunk/runtime/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/lit.cfg?rev=258169&r1=258168&r2=258169&view=diff
==============================================================================
--- openmp/trunk/runtime/test/lit.cfg (original)
+++ openmp/trunk/runtime/test/lit.cfg Tue Jan 19 13:26:43 2016
@@ -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"))
More information about the Openmp-commits
mailing list