Skip to content

Commit

Permalink
Fix multi-threading runtime library problem on Windows with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
H-YWu committed Aug 9, 2024
1 parent b005d32 commit 4fbab87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
cmake_minimum_required(VERSION 3.10)

# https://discourse.cmake.org/t/msvc-runtime-library-completely-ignored/10004
cmake_policy(SET CMP0091 NEW)

project(Bindings
DESCRIPTION
"Python bindings"
)

# MSVC needs explicit configuration for multithreading
# Select a multi-threaded statically-linked runtime library
# with or without debug information depending on the configuration
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down

0 comments on commit 4fbab87

Please sign in to comment.