Skip to content

Commit 026a86a

Browse files
Remove AUDIT defaults
1 parent c4f81a8 commit 026a86a

File tree

3 files changed

+21
-36
lines changed

3 files changed

+21
-36
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mongo_bool_setting(ENABLE_PIC "Enable position-independent-code in built static
2828
mongo_bool_setting(
2929
ENABLE_MAINTAINER_FLAGS "Enable stricter build-time checks"
3030
DEFAULT VALUE OFF
31-
AUDIT EVAL [[
31+
DEVEL EVAL [[
3232
if(MSVC)
3333
set(DEFAULT OFF)
3434
else()
@@ -40,9 +40,9 @@ mongo_bool_setting(
4040
mongo_bool_setting(ENABLE_TRACING "Enable verbose debug output in the build driver"
4141
DEFAULT VALUE OFF AUDIT VALUE ON)
4242
mongo_bool_setting(ENABLE_COVERAGE "Instrument built code for use with lcov"
43-
DEFAULT VALUE OFF AUDIT VALUE ON)
43+
DEFAULT VALUE OFF DEVEL VALUE ON)
4444
mongo_bool_setting(ENABLE_DEBUG_ASSERTIONS "Build with runtime debug assertions enabled"
45-
DEFAULT VALUE OFF AUDIT VALUE ON)
45+
DEFAULT VALUE OFF DEVEL VALUE ON)
4646
# for MONGO_SANITIZE:
4747
include(Sanitizers)
4848

@@ -114,7 +114,7 @@ mongo_bool_setting(
114114
option can often produce false positives with
115115
UndefinedBehaviorSanitizer.]]
116116
DEFAULT VALUE ON
117-
AUDIT VALUE OFF
117+
DEVEL VALUE OFF
118118
)
119119

120120
mongo_setting(ENABLE_ICU "Enable ICU support, needed for non-ASCII usernames and passwords"
@@ -159,7 +159,7 @@ mongo_bool_setting(
159159
ENABLE_AUTOMATIC_INIT_AND_CLEANUP
160160
"[Deprecated] Enable automatic initialization of the C driver library"
161161
DEFAULT VALUE ON
162-
AUDIT VALUE OFF
162+
DEVEL VALUE OFF
163163
VALIDATE CODE [[
164164
if(ENABLE_AUTOMATIC_INIT_AND_CLEANUP)
165165
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")

build/cmake/MongoSettings.cmake

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ include_guard(DIRECTORY)
22

33
#[[ Bool: Set to TRUE if the environment variable MONGODB_DEVELOPER is a true value ]]
44
set(MONGODB_DEVELOPER FALSE)
5-
#[[ Bool: Set to TRUE if the environment variable MONGODB_BUILD_AUDIT is a true value ]]
6-
set(MONGODB_BUILD_AUDIT FALSE)
75

86
# Detect developer mode:
97
set(_is_dev "$ENV{MONGODB_DEVELOPER}")
@@ -12,19 +10,12 @@ if(_is_dev)
1210
set(MONGODB_DEVELOPER TRUE)
1311
endif()
1412

15-
# Detect audit mode:
16-
set(_is_audit "$ENV{MONGODB_BUILD_AUDIT}")
17-
if(_is_audit)
18-
message(STATUS "MONGODB_BUILD_AUDIT is enabled")
19-
set(MONGODB_BUILD_AUDIT TRUE)
20-
endif()
21-
2213
#[==[
2314
Define a new configure-time build setting::
2415
mongo_setting(
2516
<name> <doc>
2617
[TYPE <BOOL|PATH|FILEPATH|STRING>]
27-
[DEFAULT [[DEVEL|AUDIT] [VALUE <value> | EVAL <code>]] ...]
18+
[DEFAULT [[DEVEL] [VALUE <value> | EVAL <code>]] ...]
2819
[OPTIONS [<opts> ...]]
2920
[VALIDATE [CODE <code>]]
3021
[ADVANCED] [ALLOW_OTHER_VALUES]
@@ -45,26 +36,27 @@ TYPE <BOOL|PATH|FILEPATH|STRING>
4536
ALLOW_OTHER_VALUES is not specified, this call will validate that the
4637
setting is a valid boolean value.
4738

48-
OPTIONS [<opts> ...]
39+
OPTIONS [<opts> [...]]
4940
Specify the valid set of values available for this setting. This will set
5041
the STRINGS property on the cache variable and add an information message to
5142
the doc string. Unless ALLOW_OTHER_VALUES is specified, this call will also
5243
validate that the setting's value is one of these options, failing with an
5344
error if it is not.
5445

55-
DEFAULT [[DEVEL|AUDIT] [VALUE <value> | EVAL <code>]] ...
56-
Specify the default value of the generated variable. If given VALUE, then
46+
DEFAULT [[DEVEL] [VALUE <value> | EVAL <code>]]
47+
[...]
48+
Specify the default value(s) of the generated variable. If given VALUE, then
5749
`<value>` will be used as the default, otherwise if given EVAL, `<code>`
5850
will be executed and is expected to define a variable DEFAULT that will
59-
contain the default value.
60-
61-
- If neither MONGODB_DEVELOPER nor MONGODB_BUILD_AUDIT are true, then the
62-
non-qualified defaults will be used. (If no non-qualified defaults are
63-
provided, then the default value is an empty string.)
64-
- Otherwise, If DEVEL defaults are provided, and MONGODB_DEVELOPER is true,
51+
contain the default value. An optional DEVEL qualifier may be given before
52+
a default value specifier. If both qualified and unqualified defaults are
53+
given, the unqualified default must appear first in the argument list.
54+
55+
- If MONGODB_DEVELOPER is not true, then the non-qualified default will be
56+
used. (If no non-qualified defaults are provided, then the default value
57+
is an empty string.)
58+
- Otherwise, If DEVEL defaults are provided and MONGODB_DEVELOPER is true,
6559
then the DEVEL defaults will be used.
66-
- Otherwise, if AUDIT defaults are provided, and either MONGODB_DEVELOPER or
67-
MONGODB_BUILD_AUDIT is true, then the AUDIT defaults will be used.
6860

6961
VALIDATE [CODE <code>]
7062
If specified, then `<code>` will be evaluated after the setting value is
@@ -200,7 +192,7 @@ function(_mongo_compute_default outvar arglist)
200192
unset("${outvar}" PARENT_SCOPE)
201193

202194
# Parse arguments:
203-
cmake_parse_arguments(dflt "" "" "DEVEL;AUDIT" ${arglist})
195+
cmake_parse_arguments(dflt "" "" "DEVEL" ${arglist})
204196

205197
# Developer-mode options:
206198
if(DEFINED dflt_DEVEL AND MONGODB_DEVELOPER)
@@ -209,13 +201,6 @@ function(_mongo_compute_default outvar arglist)
209201
message(DEBUG "Detected MONGODB_DEVELOPER: Default of ${setting_NAME} is “${tmp}”")
210202
set("${outvar}" "${tmp}" PARENT_SCOPE)
211203
return()
212-
# Audit-mode options:
213-
elseif(DEFINED dflt_AUDIT AND (MONGODB_DEVELOPER OR MONGODB_BUILD_AUDIT))
214-
list(APPEND CMAKE_MESSAGE_CONTEXT "audit")
215-
_mongo_compute_default(tmp "${dflt_AUDIT}")
216-
message(DEBUG "Detected MONGODB_BUILD_AUDIT: Default of ${setting_NAME} is “${tmp}”")
217-
set("${outvar}" "${tmp}" PARENT_SCOPE)
218-
return()
219204
endif()
220205

221206
# Parse everything else:
@@ -249,7 +234,7 @@ Define a new boolean build setting::
249234
250235
mongo_bool_setting(
251236
<name> <doc>
252-
[DEFAULT [[DEVEL|AUDIT] [VALUE <value> | EVAL <code>]] ...]
237+
[DEFAULT [[DEVEL] [VALUE <value> | EVAL <code>]] ...]
253238
[VALIDATE [CODE <code>]]
254239
[ADVANCED] [ALLOW_OTHER_VALUES]
255240
)

build/cmake/Sanitizers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include (MongoSettings)
55
mongo_setting (
66
MONGO_SANITIZE "Semicolon/comma-separated list of sanitizers to apply when building"
77
DEFAULT
8-
AUDIT EVAL [[
8+
DEVEL EVAL [[
99
if(NOT MSVC)
1010
set(DEFAULT "address,undefined")
1111
endif()

0 commit comments

Comments
 (0)