Skip to content

Commit

Permalink
windows: Set debug options if appropriate. (#798)
Browse files Browse the repository at this point in the history
* windows: Set debug options if appropriate.

If building with debug, also build standard libraries with debug. This
ensures that any libraries linking against cubeb won't have mismatched
symbol definitions.

* Properly allow dynamic linking.

* Set global CMAKE_MSVC_RUNTIME_LIBRARY.

This variable will apply to all targets, rather than needing to apply a
per-target setting.

* remove unnecessary whitespace

* Simplify variable expression
  • Loading branch information
mutexlox-signal authored Sep 16, 2024
1 parent 19d2f7b commit 877364f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# TODO
# - backend selection via command line, rather than simply detecting headers.

cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
cmake_policy(SET CMP0091 NEW)
project(cubeb
VERSION 0.0.0)

Expand All @@ -12,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>")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
Expand Down

0 comments on commit 877364f

Please sign in to comment.