Skip to content

Commit e025efb

Browse files
committed
CDRIVER-2416 implement ENABLE_BSON=ONLY build option
1 parent 213cf4b commit e025efb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ option (ENABLE_CRYPTO_SYSTEM_PROFILE "Use system crypto profile (OpenSSL only)"
3333
option (ENABLE_TRACING "Turn on verbose debug output" OFF)
3434
option (ENABLE_COVERAGE "Turn on compile options for lcov" OFF)
3535
set (ENABLE_SHM_COUNTERS AUTO CACHE STRING "Enable shared memory performance counters. Set to ON/AUTO/OFF, default AUTO.")
36-
set (ENABLE_BSON AUTO CACHE STRING "Where to find libbson. Set to BUNDLED/SYSTEM/AUTO, default AUTO.")
36+
set (ENABLE_BSON AUTO CACHE STRING "Where to find libbson. Set to BUNDLED/SYSTEM/AUTO/ONLY, default AUTO.")
3737
set (ENABLE_SNAPPY AUTO CACHE STRING "Enable snappy support. Set to ON/AUTO/OFF, default AUTO.")
3838
set (ENABLE_ZLIB AUTO CACHE STRING "Enable zlib support")
3939
option (ENABLE_MAN_PAGES "Build MongoDB C Driver manual pages." OFF)
@@ -76,7 +76,7 @@ else ()
7676
set (BSON_EXTRA_ALIGN 0)
7777
endif ()
7878

79-
if (NOT ENABLE_BSON MATCHES "SYSTEM|AUTO|BUNDLED")
79+
if (NOT ENABLE_BSON MATCHES "SYSTEM|AUTO|BUNDLED|ONLY")
8080
message (FATAL_ERROR "ENABLE_BSON option must be SYSTEM, BUNDLED, or AUTO")
8181
endif ()
8282

@@ -140,6 +140,11 @@ if (NOT BSON_LIBRARIES)
140140
set (BSON_STATIC_DEFINITIONS "BSON_STATIC")
141141
endif ()
142142

143+
# This allows skipping all the non-bson components
144+
if (ENABLE_BSON STREQUAL ONLY)
145+
return ()
146+
endif ()
147+
143148
if (ENABLE_TESTS AND NOT MONGOC_ENABLE_STATIC)
144149
message (FATAL_ERROR "ENABLE_TESTS requires ENABLE_STATIC")
145150
endif ()

0 commit comments

Comments
 (0)