Skip to content

Commit 39c9926

Browse files
authored
CXX-3288 do not initialize ENABLE_TESTS with the auto-downloaded C Driver (#1404)
* Include FetchMongoC after top-level cache variables are initialized * Set missing ENABLE_TESTS=ON for macro guard tests
1 parent 5edf096 commit 39c9926

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.evergreen/config_generator/components/macro_guards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def tasks():
4747
Compile.call(
4848
build_type='Debug',
4949
compiler=compiler,
50-
vars={'COMPILE_MACRO_GUARD_TESTS': 'ON'},
51-
)
50+
vars={'COMPILE_MACRO_GUARD_TESTS': 'ON', 'ENABLE_TESTS': 'ON'},
51+
),
5252
],
5353
)
5454
)

.evergreen/generated_configs/tasks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14187,6 +14187,7 @@ tasks:
1418714187
- func: compile
1418814188
vars:
1418914189
COMPILE_MACRO_GUARD_TESTS: "ON"
14190+
ENABLE_TESTS: "ON"
1419014191
build_type: Debug
1419114192
- name: macro-guards-rhel80-clang
1419214193
run_on: rhel80-large
@@ -14198,6 +14199,7 @@ tasks:
1419814199
- func: compile
1419914200
vars:
1420014201
COMPILE_MACRO_GUARD_TESTS: "ON"
14202+
ENABLE_TESTS: "ON"
1420114203
build_type: Debug
1420214204
cc_compiler: clang
1420314205
cxx_compiler: clang++
@@ -14211,6 +14213,7 @@ tasks:
1421114213
- func: compile
1421214214
vars:
1421314215
COMPILE_MACRO_GUARD_TESTS: "ON"
14216+
ENABLE_TESTS: "ON"
1421414217
build_type: Debug
1421514218
cc_compiler: gcc
1421614219
cxx_compiler: g++

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu
99

1010
## 4.2.0 [Unreleased]
1111

12-
<!-- Will contain entries for the next minor release. -->
12+
### Fixed
13+
14+
- CMake option `ENABLE_TESTS` (`OFF` by default) is no longer overwritten by the auto-downloaded C Driver (`ON` by default) during CMake configuration.
1315

1416
## 4.1.0
1517

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ set(BSON_REQUIRED_VERSION 2.0.0)
4949
set(MONGOC_REQUIRED_VERSION 2.0.0)
5050
set(MONGOC_DOWNLOAD_VERSION 2.0.0)
5151

52-
include(FetchMongoC)
53-
5452
# All of our target compilers support the deprecated
5553
# attribute. Normally, we would just let the GenerateExportHeader
5654
# subsystem do this via configure check, but there appears to be a
@@ -321,6 +319,8 @@ if(ENABLE_TESTS)
321319
enable_testing()
322320
endif()
323321

322+
include(FetchMongoC)
323+
324324
add_subdirectory(src)
325325

326326
add_subdirectory(examples EXCLUDE_FROM_ALL)

0 commit comments

Comments
 (0)