Skip to content

Commit c444613

Browse files
authored
MONGOCRYPT-719 resolve CMake warning of non-boolean ENABLE_EXTRA_ALIGNMENT (mongodb#875)
1 parent d09b342 commit c444613

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmake/ImportBSON.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ function (_import_bson)
140140
set (ENABLE_SNAPPY OFF CACHE BOOL "Toggle snappy for the mongoc subproject (not required by libmongocrypt)")
141141
# Disable deprecated automatic init and cleanup. (May be overridden by the user)
142142
set (ENABLE_AUTOMATIC_INIT_AND_CLEANUP OFF CACHE BOOL "Enable automatic init and cleanup (GCC only)")
143-
# Disable over-alignment of bson types. (May be overridden by the user)
144-
set (ENABLE_EXTRA_ALIGNMENT ${_extra_alignment_default} CACHE BOOL "Toggle extra alignment of bson_t")
143+
if (DEFINED _extra_alignment_default)
144+
# Disable over-alignment of bson types. (May be overridden by the user)
145+
set (ENABLE_EXTRA_ALIGNMENT ${_extra_alignment_default} CACHE BOOL "Toggle extra alignment of bson_t")
146+
endif ()
145147
# We don't want the subproject to find libmongocrypt
146148
set (ENABLE_CLIENT_SIDE_ENCRYPTION OFF CACHE BOOL "Disable client-side encryption for the libmongoc subproject")
147149
# Clear `BUILD_VERSION` so C driver does not use a `BUILD_VERSION` meant for libmongocrypt.

0 commit comments

Comments
 (0)