summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2018-03-13 12:03:17 -0400
committerGabriel Russell <gabriel.russell@mongodb.com>2018-05-03 17:26:39 -0400
commit7d16f8ed5b9c59427a294d1e13b18fc081a61ecb (patch)
tree0aaad20e4dffd7b108fcc06b964feae9558128f8 /SConstruct
parent6b23bd026bb74b1e44d93951662070076e99b361 (diff)
downloadmongo-7d16f8ed5b9c59427a294d1e13b18fc081a61ecb.tar.gz
SERVER-33067 build cdriver with cmake
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct25
1 files changed, 19 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index fa85da47db9..e02281a1df0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -360,6 +360,15 @@ add_option('use-system-intel_decimal128',
nargs=0,
)
+add_option('use-system-mongo-c',
+ choices=['on', 'off', 'auto'],
+ const='on',
+ default="auto",
+ help="use system version of the mongo-c-driver (auto will use it if it's found)",
+ nargs='?',
+ type='choice',
+)
+
add_option('use-system-all',
help='use all system libraries',
nargs=0,
@@ -3209,12 +3218,16 @@ def doConfigure(myenv):
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_MAX_EXTENDED_ALIGNMENT", size)
break
- conf.env['MONGO_HAVE_LIBMONGOC'] = conf.CheckLibWithHeader(
- ["mongoc-1.0"],
- ["mongoc.h"],
- "C",
- "mongoc_get_major_version();",
- autoadd=False )
+ mongoc_mode = get_option('use-system-mongo-c')
+ if mongoc_mode != 'off':
+ conf.env['MONGO_HAVE_LIBMONGOC'] = conf.CheckLibWithHeader(
+ ["mongoc-1.0"],
+ ["mongoc.h"],
+ "C",
+ "mongoc_get_major_version();",
+ autoadd=False )
+ if not conf.env['MONGO_HAVE_LIBMONGOC'] and mongoc_mode == 'on':
+ myenv.ConfError("Failed to find the required C driver headers")
# ask each module to configure itself and the build environment.
moduleconfig.configure_modules(mongo_modules, conf)