Skip to content

Commit

Permalink
conan_provider.cmake: fix missing runtime type detection for ClangCL
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Sep 30, 2024
1 parent 035940c commit b19fa02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions cmake/SetDefaultProfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(MSVC AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
if(BUILD_SHARED_LIBS)
# shared spdlog requires MultiThreadedDLL
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY not set, using ${CMAKE_MSVC_RUNTIME_LIBRARY}")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
10 changes: 5 additions & 5 deletions cmake/conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@ function(detect_compiler COMPILER COMPILER_VERSION COMPILER_RUNTIME COMPILER_RUN
message(STATUS "CMake-Conan: CMake compiler=${_COMPILER}")
message(STATUS "CMake-Conan: CMake compiler version=${_COMPILER_VERSION}")

if(_COMPILER MATCHES MSVC)
set(_COMPILER "msvc")
string(SUBSTRING ${MSVC_VERSION} 0 3 _COMPILER_VERSION)
if(MSVC)
# Configure compiler.runtime and compiler.runtime_type settings for MSVC
if(CMAKE_MSVC_RUNTIME_LIBRARY)
set(_msvc_runtime_library ${CMAKE_MSVC_RUNTIME_LIBRARY})
Expand Down Expand Up @@ -252,9 +250,11 @@ function(detect_compiler COMPILER COMPILER_VERSION COMPILER_RUNTIME COMPILER_RUN
endif()
message(STATUS "CMake-Conan: CMake compiler.runtime_type=${_COMPILER_RUNTIME_TYPE}")
endif()
endif()

unset(_KNOWN_MSVC_RUNTIME_VALUES)

if(_COMPILER MATCHES MSVC)
set(_COMPILER "msvc")
string(SUBSTRING ${MSVC_VERSION} 0 3 _COMPILER_VERSION)
elseif(_COMPILER MATCHES AppleClang)
set(_COMPILER "apple-clang")
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
Expand Down

0 comments on commit b19fa02

Please sign in to comment.