Skip to content

Commit 41ae2b5

Browse files
Link MSVC runtime library statically (#130)
This change makes all CMake targets to use `-MT`/`-MTd` compilation flags for Windows MSVC builds. This way the MSVC runtime library is linked statically and the workaround for VS2019 described in duckdb/duckdb#17991 is no longer necessary. `extension-ci-tools` PR: duckdb/extension-ci-tools#276 Ref: duckdblabs/duckdb-internal#2036
2 parents 3649e17 + e8ee9d3 commit 41ae2b5

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ project(duckdb_py LANGUAGES CXX)
66
set(CMAKE_CXX_STANDARD 11)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88
set(CMAKE_CXX_EXTENSIONS OFF)
9+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
910

1011
# Set the library name
1112
set(DUCKDB_PYTHON_LIB_NAME "_duckdb")

cmake/duckdb_loader.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ function(_duckdb_create_interface_target target_name)
197197
/wd26451
198198
/wd26495 # suppress Code Analysis
199199
/D_CRT_SECURE_NO_WARNINGS # suppress warnings about unsafe functions
200-
/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # see
201-
# https://github.com/duckdblabs/duckdb-internal/issues/5151
202200
/utf-8 # treat source files as UTF-8 encoded
203201
)
204202
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

0 commit comments

Comments
 (0)