Commit 2302855e authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r258169:

------------------------------------------------------------------------
r258169 | hans | 2016-01-19 11:26:43 -0800 (Tue, 19 Jan 2016) | 4 lines

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: 258171
parent f6eda69b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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"))