Skip to content

Commit 730da27

Browse files
authored
MONGOCRYPT-845 rename mlib directory to avoid header conflicts (#1070)
1 parent 7c67bb5 commit 730da27

32 files changed

+43
-43
lines changed

CMakeLists.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,22 @@ configure_file (
233233
"${PROJECT_BINARY_DIR}/src/mongocrypt-config.h"
234234
)
235235

236-
# Define the mlib target, which is private and header-only. It is not exported
236+
# Define the mc-mlib target, which is private and header-only. It is not exported
237237
# nor are its headers installed.
238-
add_library (_mongo-mlib INTERFACE)
239-
add_library (mongo::mlib ALIAS _mongo-mlib)
240-
list (APPEND MLIB_DEFINITIONS MLIB_USER)
238+
add_library (_mongo-mc-mlib INTERFACE)
239+
add_library (mongo::mc-mlib ALIAS _mongo-mc-mlib)
240+
list (APPEND MCMLIB_DEFINITIONS MLIB_USER)
241241
CHECK_INCLUDE_FILE (strings.h HAVE_STRINGS_H)
242242
if (HAVE_STRINGS_H)
243-
list (APPEND MLIB_DEFINITIONS MLIB_HAVE_STRINGS_H)
243+
list (APPEND MCMLIB_DEFINITIONS MLIB_HAVE_STRINGS_H)
244244
endif ()
245245
set_property(
246-
TARGET _mongo-mlib
246+
TARGET _mongo-mc-mlib
247247
APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS
248-
${MLIB_DEFINITIONS}
248+
${MCMLIB_DEFINITIONS}
249249
)
250250
set_property(
251-
TARGET _mongo-mlib
251+
TARGET _mongo-mc-mlib
252252
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
253253
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
254254
)
@@ -271,7 +271,7 @@ target_link_libraries (
271271
PRIVATE
272272
_mongocrypt::libbson_for_shared
273273
kms_message_static
274-
$<BUILD_INTERFACE:mongo::mlib>
274+
$<BUILD_INTERFACE:mongo::mc-mlib>
275275
PUBLIC
276276
mongocrypt::platform
277277
${maybe_dfp_library}
@@ -327,7 +327,7 @@ target_link_libraries (
327327
PRIVATE
328328
_mongocrypt::libbson_for_static
329329
kms_message_static
330-
$<BUILD_INTERFACE:mongo::mlib>
330+
$<BUILD_INTERFACE:mongo::mc-mlib>
331331
PUBLIC
332332
mongocrypt::platform
333333
${maybe_dfp_library}
@@ -507,7 +507,7 @@ set (TEST_MONGOCRYPT_SOURCES
507507
add_executable (test-mongocrypt ${TEST_MONGOCRYPT_SOURCES})
508508
# Use the static version since it allows the test binary to use private symbols
509509
target_include_directories (test-mongocrypt PRIVATE ./src "${CMAKE_CURRENT_SOURCE_DIR}/kms-message/src")
510-
target_link_libraries (test-mongocrypt PRIVATE _mongocrypt::libbson_for_static mongocrypt_static mongo::mlib)
510+
target_link_libraries (test-mongocrypt PRIVATE _mongocrypt::libbson_for_static mongocrypt_static mongo::mc-mlib)
511511
target_include_directories (test-mongocrypt PRIVATE "${CMAKE_CURRENT_LIST_DIR}/test")
512512
target_compile_definitions (test-mongocrypt PRIVATE
513513
# Set a definition so that testcases can know where test-mongocrypt.exe was written to
@@ -525,9 +525,9 @@ add_test (
525525
)
526526

527527
foreach (test IN ITEMS path str)
528-
add_executable (mlib.${test}.test src/mlib/${test}.test.c)
528+
add_executable (mlib.${test}.test src/mc-mlib/${test}.test.c)
529529
add_test (mlib.${test} mlib.${test}.test)
530-
target_link_libraries (mlib.${test}.test PRIVATE mongo::mlib)
530+
target_link_libraries (mlib.${test}.test PRIVATE mongo::mc-mlib)
531531
endforeach ()
532532

533533
if ("cxx_relaxed_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
@@ -545,7 +545,7 @@ if ("cxx_relaxed_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
545545
target_compile_features ("${exe_name}" PRIVATE cxx_relaxed_constexpr)
546546
target_link_libraries ("${exe_name}" PRIVATE
547547
mongocrypt
548-
mongo::mlib
548+
mongo::mc-mlib
549549
${maybe_dfp_library}
550550
_mongocrypt::libbson_for_static
551551
)
@@ -555,7 +555,7 @@ endif ()
555555

556556
if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
557557
add_executable (csfle-markup src/csfle-markup.cpp)
558-
target_link_libraries (csfle-markup PRIVATE mongocrypt_static _mongocrypt::libbson_for_static mongo::mlib)
558+
target_link_libraries (csfle-markup PRIVATE mongocrypt_static _mongocrypt::libbson_for_static mongo::mc-mlib)
559559
target_compile_features (csfle-markup PRIVATE cxx_std_20)
560560
endif ()
561561

@@ -606,8 +606,8 @@ install (
606606
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
607607
)
608608

609-
# This export set is not installed, and is only to allow export() of the mlib-using targets
610-
install (TARGETS _mongo-mlib EXPORT _exports_for_export)
609+
# This export set is not installed, and is only to allow export() of the mc-mlib-using targets
610+
install (TARGETS _mongo-mc-mlib EXPORT _exports_for_export)
611611
export (EXPORT _exports_for_export)
612612

613613
install (

src/mc-dec128.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
#include <bson/bson.h>
55

6-
#include <mlib/endian.h>
7-
#include <mlib/int128.h>
8-
#include <mlib/macros.h>
6+
#include <mc-mlib/endian.h>
7+
#include <mc-mlib/int128.h>
8+
#include <mc-mlib/macros.h>
99

1010
// Conditional preprocessor definition set by the usage of an intel_dfp from
1111
// the ImportDFP.cmake script:

src/mc-dec128.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <stdlib.h>
88

9-
#include <mlib/check.hpp>
9+
#include <mc-mlib/check.hpp>
1010
#define CHECK MLIB_CHECK
1111

1212
inline std::ostream &operator<<(std::ostream &out, mc_dec128 d) noexcept {

src/mc-efc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "mc-efc-private.h"
1818

19-
#include "mlib/str.h"
19+
#include "mc-mlib/str.h"
2020
#include "mongocrypt-private.h"
2121
#include "mongocrypt-util-private.h" // mc_iter_document_as_bson
2222
#include <stdint.h>

src/mc-fle2-rfds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "mc-fle-blob-subtype-private.h" // MC_SUBTYPE_FLE2EncryptionPlaceholder
2121
#include "mongocrypt-private.h" // CLIENT_ERR
2222

23-
#include "mlib/thread.h" // mlib_once_flag
24-
#include <math.h> // INFINITY
23+
#include "mc-mlib/thread.h" // mlib_once_flag
24+
#include <math.h> // INFINITY
2525

2626
static mc_FLE2RangeOperator_t get_operator_type(const char *key) {
2727
BSON_ASSERT_PARAM(key);
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)