diff options
author | Robert Guo <robertguo@me.com> | 2018-01-27 11:37:24 -0500 |
---|---|---|
committer | Robert Guo <robertguo@me.com> | 2018-01-27 11:39:46 -0500 |
commit | 8d9b68094ca79bce5da7cf530a2e14383b466a72 (patch) | |
tree | 32ae219957779a2baf60d26a42e7086e015f473a /src/third_party/SConscript | |
parent | 0aeb5ce7e8d4a190dac43fd110533eef149f7880 (diff) | |
download | mongo-8d9b68094ca79bce5da7cf530a2e14383b466a72.tar.gz |
SERVER-32785 integrate Google Benchmark with SCons
Diffstat (limited to 'src/third_party/SConscript')
-rw-r--r-- | src/third_party/SConscript | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/third_party/SConscript b/src/third_party/SConscript index 416ef7a92a8..d8156e7c819 100644 --- a/src/third_party/SConscript +++ b/src/third_party/SConscript @@ -15,6 +15,7 @@ icuSuffix = '-57.1' gperftoolsSuffix = '-2.5' timelibSuffix = '-2017.05' tomcryptSuffix = '-1.18.0-rc2' +benchmarkSuffix = '-1.3.0' thirdPartyIncludePathList = [ ('s2', '#/src/third_party/s2'), @@ -47,6 +48,10 @@ if not use_system_version_of_library('zlib'): thirdPartyIncludePathList.append( ('zlib', '#/src/third_party/zlib' + zlibSuffix)) +if not use_system_version_of_library('google-benchmark'): + thirdPartyIncludePathList.append( + ('benchmark', '#/src/third_party/benchmark' + benchmarkSuffix + '/benchmark/include')) + # TODO: figure out if we want to offer system versions of mozjs. Mozilla # hasn't offered a source tarball since 24, but in theory they could. # @@ -214,6 +219,28 @@ zlibEnv.Library( 'shim_zlib.cpp', ]) +if use_system_version_of_library("google-benchmark"): + benchmarkEnv = env.Clone( + SYSLIBDEPS=[ + env['LIBDEPS_BENCHMARK_SYSLIBDEP'], + ]) +else: + benchmarkEnv = env.Clone() + benchmarkEnv.InjectThirdPartyIncludePaths(libraries=['benchmark']) + benchmarkEnv.SConscript( + 'benchmark' + benchmarkSuffix + '/SConscript', + exports={ 'env' : benchmarkEnv }) + benchmarkEnv = benchmarkEnv.Clone( + LIBDEPS_INTERFACE=[ + 'benchmark' + benchmarkSuffix + '/benchmark', + ]) + +benchmarkEnv.Library( + target="shim_benchmark", + source=[ + 'shim_benchmark.cpp', + ]) + if usemozjs: mozjsEnv = env.Clone() mozjsEnv.SConscript('mozjs' + mozjsSuffix + '/SConscript', exports={'env' : mozjsEnv }) |