summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2018-05-25 17:03:36 -0400
committerGabriel Russell <gabriel.russell@mongodb.com>2018-06-01 17:00:16 -0400
commit9bdb3df40dbdc5bfa49271d0da69bdea0b000d90 (patch)
tree2b8b83d8949bf8d309c594dadbb66dbe281a1980 /SConstruct
parent2c6bf9ead4270ffce87eda37b032848e89f86bc7 (diff)
downloadmongo-9bdb3df40dbdc5bfa49271d0da69bdea0b000d90.tar.gz
SERVER-33101 use mongo-c version 1.10 in embedded
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct18
1 files changed, 18 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 28879216254..1d22ad34d98 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3251,6 +3251,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':
@@ -3262,6 +3278,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)