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"]