From 86591dbfbf91707cb5c8b9adf4a860978b61125f Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 16 Jan 2019 09:57:20 +0100 Subject: [PATCH] Fixed GEM & PyPI packages to use SDK from Xcode when building the extension --- ice/gem/extconf.rb | 4 ++++ ice/pypi/setup.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ice/gem/extconf.rb b/ice/gem/extconf.rb index 19523f1..1eef6c1 100644 --- a/ice/gem/extconf.rb +++ b/ice/gem/extconf.rb @@ -5,6 +5,7 @@ # ********************************************************************** require "mkmf" +require "rbconfig" if RUBY_PLATFORM =~ /mswin|mingw/ puts "MinGW is not supported with Ice for Ruby." @@ -32,6 +33,9 @@ # if RUBY_PLATFORM =~ /darwin/ $ARCH_FLAG = "-arch x86_64" + # Make sure to use the SDK from Xcode (required for Sierra where old system headers can be used otherwise) + RbConfig::MAKEFILE_CONFIG['CC'] = 'xcrun -sdk macosx clang' + RbConfig::MAKEFILE_CONFIG['CXX'] = 'xcrun -sdk macosx clang++' end $INCFLAGS << ' -Iice/cpp/include' diff --git a/ice/pypi/setup.py b/ice/pypi/setup.py index 5cbb755..b6a66cb 100644 --- a/ice/pypi/setup.py +++ b/ice/pypi/setup.py @@ -60,6 +60,9 @@ if platform == 'darwin': if not 'ARCHFLAGS' in os.environ: os.environ['ARCHFLAGS'] = '-arch x86_64' + # Make sure to use the SDK from Xcode (required for Sierra where old system headers can be used otherwise) + os.environ['CC'] = 'xcrun -sdk macosx clang' + os.environ['CXX'] = 'xcrun -sdk macosx clang++' extra_compile_args.append('-w') if use_ice: libraries = ["IceSSL", "IceLocatorDiscovery", "IceDiscovery", "Ice"]