0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 16:46:00 +01:00
mongodb/etc/scons/icecream_homebrew_macosx.vars

29 lines
1.1 KiB
Plaintext

# Configures the build to use Toolchain Clang to build with icecream
# cross compiling for macOS, using homebrew for local and the MongoDB
# toolchain for remote. You will need brew's llvm@7 installed.
import os
import subprocess
import SCons.Defaults
exec(open('etc/scons/xcode_macosx.vars', "rb").read())
# TODO: When we bump the toolchain, these need to move to an equivalent
# LLVM version. Currently, the stable MongoDB toolchain (v3) uses clang 7.
CC = "/usr/local/opt/llvm@7/bin/clang"
CXX = "/usr/local/opt/llvm@7/bin/clang++"
for tool in [CC, CXX]:
try:
result = subprocess.check_output([tool, '--version']).decode('utf-8').strip()
except subprocess.CalledProcessError as e:
print('Failed while invoking toolchain binary ' + CXX + ': ' + str(e.output))
print('Please ensure that the homebrew llvm@7 package is correctly installed')
SCons.Script.Exit(-1)
except OSError as e:
print('Failed to invoke toolchain binary ' + CXX + ': ' + str(e))
print('Please install the homebrew llvm@7 package')
SCons.Script.Exit(-1)
exec(open('etc/scons/icecream_remote_mongodbtoolchain.vars', "rb").read())