diff options
| author | Gabriel Russell <gabriel.russell@mongodb.com> | 2018-05-25 17:03:36 -0400 |
|---|---|---|
| committer | Henrik Edin <henrik.edin@mongodb.com> | 2018-06-01 17:26:05 -0400 |
| commit | ceebaf256ca6f4d4d1d220e4d07142e5db1a01d1 (patch) | |
| tree | c2026944d701ec23067365424a97c50b120df283 /SConstruct | |
| parent | 546ea087caa919d59eb5f40efeb01c3f48dff36c (diff) | |
| download | mongo-ceebaf256ca6f4d4d1d220e4d07142e5db1a01d1.tar.gz | |
SERVER-33101 use mongo-c version 1.10 in embedded
(cherry picked from commit 9bdb3df40dbdc5bfa49271d0da69bdea0b000d90)
Diffstat (limited to 'SConstruct')
| -rw-r--r-- | SConstruct | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index 8ab0fd8faaf..f9006e01dda 100644 --- a/SConstruct +++ b/SConstruct @@ -3224,6 +3224,22 @@ def doConfigure(myenv): conf.env.SetConfigHeaderDefine("MONGO_CONFIG_MAX_EXTENDED_ALIGNMENT", size) break + def CheckMongoCMinVersion(context): + compile_test_body = textwrap.dedent(""" + #include <mongoc.h> + + #if !MONGOC_CHECK_VERSION(1,10,0) + #error + #endif + """) + + context.Message("Checking if mongoc version is 1.10.0 or newer...") + result = context.TryCompile(compile_test_body, ".cpp") + context.Result(result) + return result + + conf.AddTest('CheckMongoCMinVersion', CheckMongoCMinVersion) + mongoc_mode = get_option('use-system-mongo-c') conf.env['MONGO_HAVE_LIBMONGOC'] = False if mongoc_mode != 'off': @@ -3235,6 +3251,8 @@ def doConfigure(myenv): autoadd=False ) if not conf.env['MONGO_HAVE_LIBMONGOC'] and mongoc_mode == 'on': myenv.ConfError("Failed to find the required C driver headers") + if conf.env['MONGO_HAVE_LIBMONGOC'] and not conf.CheckMongoCMinVersion(): + myenv.ConfError("Version of mongoc is too old. Version 1.10+ required") # ask each module to configure itself and the build environment. moduleconfig.configure_modules(mongo_modules, conf) |
