Skip to content

Commit 03cba71

Browse files
committed
MONGOCRYPT-845 rename mlib directory to avoid header conflicts (#1070)
1 parent dda7f02 commit 03cba71

32 files changed

+43
-43
lines changed

CMakeLists.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -257,22 +257,22 @@ configure_file (
257257
"${PROJECT_BINARY_DIR}/src/mongocrypt-config.h"
258258
)
259259

260-
# Define the mlib target, which is private and header-only. It is not exported
260+
# Define the mc-mlib target, which is private and header-only. It is not exported
261261
# nor are its headers installed.
262-
add_library (_mongo-mlib INTERFACE)
263-
add_library (mongo::mlib ALIAS _mongo-mlib)
264-
list (APPEND MLIB_DEFINITIONS MLIB_USER)
262+
add_library (_mongo-mc-mlib INTERFACE)
263+
add_library (mongo::mc-mlib ALIAS _mongo-mc-mlib)
264+
list (APPEND MCMLIB_DEFINITIONS MLIB_USER)
265265
CHECK_INCLUDE_FILE (strings.h HAVE_STRINGS_H)
266266
if (HAVE_STRINGS_H)
267-
list (APPEND MLIB_DEFINITIONS MLIB_HAVE_STRINGS_H)
267+
list (APPEND MCMLIB_DEFINITIONS MLIB_HAVE_STRINGS_H)
268268
endif ()
269269
set_property(
270-
TARGET _mongo-mlib
270+
TARGET _mongo-mc-mlib
271271
APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS
272-
${MLIB_DEFINITIONS}
272+
${MCMLIB_DEFINITIONS}
273273
)
274274
set_property(
275-
TARGET _mongo-mlib
275+
TARGET _mongo-mc-mlib
276276
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
277277
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
278278
)
@@ -295,7 +295,7 @@ target_link_libraries (
295295
PRIVATE
296296
_mongocrypt::libbson_for_shared
297297
kms_message_static
298-
$<BUILD_INTERFACE:mongo::mlib>
298+
$<BUILD_INTERFACE:mongo::mc-mlib>
299299
PUBLIC
300300
mongocrypt::platform
301301
${maybe_dfp_library}
@@ -351,7 +351,7 @@ target_link_libraries (
351351
PRIVATE
352352
_mongocrypt::libbson_for_static
353353
kms_message_static
354-
$<BUILD_INTERFACE:mongo::mlib>
354+
$<BUILD_INTERFACE:mongo::mc-mlib>
355355
PUBLIC
356356
mongocrypt::platform
357357
${maybe_dfp_library}
@@ -531,7 +531,7 @@ set (TEST_MONGOCRYPT_SOURCES
531531
add_executable (test-mongocrypt ${TEST_MONGOCRYPT_SOURCES})
532532
# Use the static version since it allows the test binary to use private symbols
533533
target_include_directories (test-mongocrypt PRIVATE ./src "${CMAKE_CURRENT_SOURCE_DIR}/kms-message/src")
534-
target_link_libraries (test-mongocrypt PRIVATE _mongocrypt::libbson_for_static mongocrypt_static mongo::mlib)
534+
target_link_libraries (test-mongocrypt PRIVATE _mongocrypt::libbson_for_static mongocrypt_static mongo::mc-mlib)
535535
target_include_directories (test-mongocrypt PRIVATE "${CMAKE_CURRENT_LIST_DIR}/test")
536536
target_compile_definitions (test-mongocrypt PRIVATE
537537
# Set a definition so that testcases can know where test-mongocrypt.exe was written to
@@ -549,9 +549,9 @@ add_test (
549549
)
550550

551551
foreach (test IN ITEMS path str)
552-
add_executable (mlib.${test}.test src/mlib/${test}.test.c)
552+
add_executable (mlib.${test}.test src/mc-mlib/${test}.test.c)
553553
add_test (mlib.${test} mlib.${test}.test)
554-
target_link_libraries (mlib.${test}.test PRIVATE mongo::mlib)
554+
target_link_libraries (mlib.${test}.test PRIVATE mongo::mc-mlib)
555555
endforeach ()
556556

557557
if ("cxx_relaxed_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
@@ -569,7 +569,7 @@ if ("cxx_relaxed_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
569569
target_compile_features ("${exe_name}" PRIVATE cxx_relaxed_constexpr)
570570
target_link_libraries ("${exe_name}" PRIVATE
571571
mongocrypt
572-
mongo::mlib
572+
mongo::mc-mlib
573573
${maybe_dfp_library}
574574
_mongocrypt::libbson_for_static
575575
)
@@ -579,7 +579,7 @@ endif ()
579579

580580
if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
581581
add_executable (csfle-markup src/csfle-markup.cpp)
582-
target_link_libraries (csfle-markup PRIVATE mongocrypt_static _mongocrypt::libbson_for_static mongo::mlib)
582+
target_link_libraries (csfle-markup PRIVATE mongocrypt_static _mongocrypt::libbson_for_static mongo::mc-mlib)
583583
target_compile_features (csfle-markup PRIVATE cxx_std_20)
584584
endif ()
585585

@@ -630,8 +630,8 @@ install (
630630
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
631631
)
632632

633-
# This export set is not installed, and is only to allow export() of the mlib-using targets
634-
install (TARGETS _mongo-mlib EXPORT _exports_for_export)
633+
# This export set is not installed, and is only to allow export() of the mc-mlib-using targets
634+
install (TARGETS _mongo-mc-mlib EXPORT _exports_for_export)
635635
export (EXPORT _exports_for_export)
636636

637637
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)