From 99fa3f9578e483b126d2eccdbc4e3d4248aacb91 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Tue, 13 Nov 2018 11:12:00 -0800 Subject: [PATCH] build: (fixes #2637) macOS SDK headers in non-standard place --- src/config-store/wscript | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/config-store/wscript b/src/config-store/wscript index 0f9a4f951..eedc2b687 100644 --- a/src/config-store/wscript +++ b/src/config-store/wscript @@ -1,6 +1,8 @@ ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- import wutils +import sys +import subprocess from waflib import Options # Bug 2936 gcc version issue for GTK+ and -Wparentheses @@ -80,6 +82,15 @@ def build(bld): if bld.env['ENABLE_LIBXML2']: module.source.append('model/xml-config.cc') module.use.append('LIBXML2') + # Bug 2637: use xcrun utility to find where macOS puts headers + if sys.platform == 'darwin': + find_sdk_path = '/usr/bin/xcrun --show-sdk-path'.split() + try: + p = subprocess.Popen(find_sdk_path, stdout=subprocess.PIPE) + xcrun_output = p.stdout.read().strip() + module.includes = xcrun_output + '/usr/include/libxml2' + except OSError: + pass if bld.env['ENABLE_EXAMPLES']: bld.recurse('examples')