Skip to content

Commit 86591db

Browse files
committed
Fixed GEM & PyPI packages to use SDK from Xcode when building the extension
1 parent 036baa6 commit 86591db

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ice/gem/extconf.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# **********************************************************************
66

77
require "mkmf"
8+
require "rbconfig"
89

910
if RUBY_PLATFORM =~ /mswin|mingw/
1011
puts "MinGW is not supported with Ice for Ruby."
@@ -32,6 +33,9 @@
3233
#
3334
if RUBY_PLATFORM =~ /darwin/
3435
$ARCH_FLAG = "-arch x86_64"
36+
# Make sure to use the SDK from Xcode (required for Sierra where old system headers can be used otherwise)
37+
RbConfig::MAKEFILE_CONFIG['CC'] = 'xcrun -sdk macosx clang'
38+
RbConfig::MAKEFILE_CONFIG['CXX'] = 'xcrun -sdk macosx clang++'
3539
end
3640

3741
$INCFLAGS << ' -Iice/cpp/include'

ice/pypi/setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
if platform == 'darwin':
6161
if not 'ARCHFLAGS' in os.environ:
6262
os.environ['ARCHFLAGS'] = '-arch x86_64'
63+
# Make sure to use the SDK from Xcode (required for Sierra where old system headers can be used otherwise)
64+
os.environ['CC'] = 'xcrun -sdk macosx clang'
65+
os.environ['CXX'] = 'xcrun -sdk macosx clang++'
6366
extra_compile_args.append('-w')
6467
if use_ice:
6568
libraries = ["IceSSL", "IceLocatorDiscovery", "IceDiscovery", "Ice"]

0 commit comments

Comments
 (0)