Skip to content

Commit

Permalink
Merge pull request #155 from cmourglia/develop
Browse files Browse the repository at this point in the history
Pure C projects had errors in detect_vs_runtime()
  • Loading branch information
memsharded authored Jul 8, 2019
2 parents 5f3ebba + 76f21cc commit 1526e26
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,16 @@ function(conan_cmake_detect_vs_runtime result)
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
set(variables CMAKE_CXX_FLAGS_${build_type} CMAKE_C_FLAGS_${build_type} CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
foreach(variable ${variables})
string(REPLACE " " ";" flags ${${variable}})
foreach (flag ${flags})
if(${flag} STREQUAL "/MD" OR ${flag} STREQUAL "/MDd" OR ${flag} STREQUAL "/MT" OR ${flag} STREQUAL "/MTd")
string(SUBSTRING ${flag} 1 -1 runtime)
set(${result} ${runtime} PARENT_SCOPE)
return()
endif()
endforeach()
if(NOT "${${variable}}" STREQUAL "")
string(REPLACE " " ";" flags ${${variable}})
foreach (flag ${flags})
if(${flag} STREQUAL "/MD" OR ${flag} STREQUAL "/MDd" OR ${flag} STREQUAL "/MT" OR ${flag} STREQUAL "/MTd")
string(SUBSTRING ${flag} 1 -1 runtime)
set(${result} ${runtime} PARENT_SCOPE)
return()
endif()
endforeach()
endif()
endforeach()
if(${build_type} STREQUAL "DEBUG")
set(${result} "MDd" PARENT_SCOPE)
Expand Down

0 comments on commit 1526e26

Please sign in to comment.