blob: 0ba7164a456744fa1454e411026c768304c7306e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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())
|