Fix python3 issue in macOS logic (#327)

Fixes iodide-project/pyodide#84
This commit is contained in:
xcodebuild
2019-08-28 04:22:50 +08:00
committed by Alon Zakai
parent 7bc47b7232
commit 5c93ca29bd

7
emsdk
View File

@@ -956,7 +956,10 @@ def cmake_configure(generator, build_root, src_root, build_type, extra_cmake_arg
def xcode_sdk_version():
try:
return subprocess.check_output(['xcrun', '--show-sdk-version']).strip().split('.')
output = subprocess.check_output(['xcrun', '--show-sdk-version'])
if sys.version_info >= (3,):
output = output.decode('utf8')
return output.strip().split('.')
except:
return subprocess.checkplatform.mac_ver()[0].split('.')
@@ -1018,7 +1021,7 @@ def build_llvm_tool(tool):
# MacOS < 10.13 workaround for LLVM build bug https://github.com/kripken/emscripten/issues/5418:
# specify HAVE_FUTIMENS=0 in the build if building with target SDK that is older than 10.13.
if OSX and (not os.environ.get('LLVM_CMAKE_ARGS') or 'HAVE_FUTIMENS' not in os.environ.get('LLVM_CMAKE_ARGS')) and xcode_sdk_version() < [10, 13]:
if OSX and (not os.environ.get('LLVM_CMAKE_ARGS') or 'HAVE_FUTIMENS' not in os.environ.get('LLVM_CMAKE_ARGS')) and xcode_sdk_version() < ['10', '13']:
print('Passing -DHAVE_FUTIMENS=0 to LLVM CMake configure to workaround https://github.com/kripken/emscripten/issues/5418. Please update to macOS 10.13 or newer')
args += ['-DHAVE_FUTIMENS=0']