diff options
Diffstat (limited to 'etc/scons/icecream_homebrew_macosx.vars')
-rw-r--r-- | etc/scons/icecream_homebrew_macosx.vars | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/scons/icecream_homebrew_macosx.vars b/etc/scons/icecream_homebrew_macosx.vars new file mode 100644 index 00000000000..0ba7164a456 --- /dev/null +++ b/etc/scons/icecream_homebrew_macosx.vars @@ -0,0 +1,28 @@ +# 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()) |