Skip to content

Commit

Permalink
Set global CMAKE_MSVC_RUNTIME_LIBRARY.
Browse files Browse the repository at this point in the history
This variable will apply to all targets, rather than needing to apply a
per-target setting.
  • Loading branch information
mutexlox-signal committed Sep 16, 2024
1 parent 05ffd8a commit 875dde4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ option(BUILD_TOOLS "Build tools" ON)
option(BUNDLE_SPEEX "Bundle the speex library" OFF)
option(LAZY_LOAD_LIBS "Lazily load shared libraries" ON)
option(USE_SANITIZERS "Use sanitizers" ON)
# Set debugging for runtime libraries if requested.
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_LIBS}>:DLL>")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
Expand Down Expand Up @@ -86,11 +88,6 @@ add_library(cubeb
src/cubeb_strings.c
src/cubeb_utils.cpp
)
# Set debugging for runtime libraries if requested.
if (MSVC)
set_property(TARGET cubeb PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_LIBS}>:DLL>")
endif()

target_include_directories(cubeb
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
Expand Down

0 comments on commit 875dde4

Please sign in to comment.