Skip to content

Commit c3628c9

Browse files
committed
Link MSVC runtime library statically
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
1 parent bbd4389 commit c3628c9

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
@@ -198,8 +198,6 @@ function(_duckdb_create_interface_target target_name)
198198
/wd26451
199199
/wd26495 # suppress Code Analysis
200200
/D_CRT_SECURE_NO_WARNINGS # suppress warnings about unsafe functions
201-
/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # see
202-
# https://github.com/duckdblabs/duckdb-internal/issues/5151
203201
/utf-8 # treat source files as UTF-8 encoded
204202
)
205203
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

0 commit comments

Comments
 (0)