Skip to content

Commit

Permalink
Set MSVC_RUNTIME only if it is not set
Browse files Browse the repository at this point in the history
This allows parent CMake to set it if they want but still
provides standalone users a reasonable default (static)
  • Loading branch information
baconpaul committed Jul 7, 2024
1 parent 6f37cc7 commit 48861ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ cmake_minimum_required(VERSION 3.21)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13 CACHE STRING "Minimum macOS version")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build Universal Always")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") # Statically link the MSVC Runtime
if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
if (WIN32)
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY not defined. Setting to static link")
endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") # Statically link the MSVC Runtime
endif()
set(CMAKE_COLOR_DIAGNOSTICS ON)

# If your clap supports note expressions you *can* implement the wrapper extension here or you
Expand Down

0 comments on commit 48861ec

Please sign in to comment.