Skip to content

build: select the correct DLL build type #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()

# Enable Policy 0091 to select MSVC runtime library by flags
if(POLICY CMP0091)
cmake_policy(CMP0091 NEW)
endif()

project(dispatch
VERSION 1.3
LANGUAGES C CXX)
Expand Down Expand Up @@ -40,6 +45,9 @@ set(CMAKE_C_VISIBILITY_INLINES_HIDDEN YES)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# NOTE(compnerd) default to /MD or /MDd based upon the configuration
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
Expand Down