# 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())