Skip to content

Commit

Permalink
mac: Add -isysroot flag to clang command (see #3836)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Zhou authored and magreenblatt committed Feb 14, 2025
1 parent 144e01e commit e902b1f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/clang_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,17 @@ def clang_eval(file_name,
lang += '-header'
# The -P option removes unnecessary line markers and whitespace.
format = '/EP' if sys.platform == 'win32' else '-E -P'
cmd = "%s -x %s %s %s %s -" % (clang_exe, lang, format,
' '.join(['-D' + v for v in defines]),
' '.join(['-I' + v for v in includes]))

sdkroot = ''
if sys.platform == 'darwin':
result = exec_cmd('xcrun --show-sdk-path', '.')
if result['ret'] == 0:
sdkroot = " -isysroot %s" % result['out'].strip()

cmd = "%s -x %s %s %s %s %s -" % (clang_exe, lang, format,
' '.join(['-D' + v for v in defines]),
' '.join(['-I' + v
for v in includes]), sdkroot)
if verbose:
print('--- Running "%s" in "%s"' % (cmd, cef_dir))

Expand Down

0 comments on commit e902b1f

Please sign in to comment.