Skip to content

Commit 49cf995

Browse files
Use CMake's builtin control for MSVCRT link mode
libmongocrypt provided a configuration parameter to control the type of the MSVC runtime library. This parameter was redundant with the control that is offered by CMake already. Prefer instead to use that control. The parameter, CMAKE_MSVC_RUNTIME_LIBRARY, was added in CMake 3.15, which is the minimum CMake version required by libmongocrypt.
1 parent cf8f9f6 commit 49cf995

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/scripts/libmongocrypt.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,16 @@ export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot, option
9999
});
100100

101101
const WINDOWS_CMAKE_FLAGS =
102-
process.platform === 'win32' // Windows is still called "win32" when it is 64-bit
103-
? toCLIFlags({ Thost: 'x64', A: 'x64', DENABLE_WINDOWS_STATIC_RUNTIME: 'ON' })
102+
process.platform === 'win32'
103+
? toCLIFlags({
104+
// Tell CMake that binaries should link with the static MSVC runtime instead of
105+
// the default dynamic one.
106+
DCMAKE_MSVC_RUNTIME_LIBRARY: 'MultiThreaded$<$<CONFIG:Debug>:Debug>',
107+
// Tell CMake to use the MSVC 64-bit compiler toolchain
108+
T: 'host=x64',
109+
// Tell CMake to generate a 64-bit binaries
110+
A: 'x64',
111+
})
104112
: [];
105113

106114
const DARWIN_CMAKE_FLAGS =

0 commit comments

Comments
 (0)