Change the MSVC static runtime CMake option name and moved it into the library directory

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Krzysztof Stachowiak 2018-10-31 12:46:37 +01:00 committed by Dave Rodgman
parent bb54237ecf
commit de6effa645
2 changed files with 12 additions and 12 deletions

View File

@ -242,18 +242,6 @@ if(MBEDTLS_FATAL_WARNINGS)
endif(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNU) endif(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNU)
endif(MBEDTLS_FATAL_WARNINGS) endif(MBEDTLS_FATAL_WARNINGS)
if(MSVC)
option(BUILD_WITH_STATIC_RUNTIME "Build the libraries with /MT compiler flag" OFF)
if(BUILD_WITH_STATIC_RUNTIME)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_CHECK)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endforeach(flag_var)
endif()
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Coverage") if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
if(CMAKE_COMPILER_IS_GNU OR CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_GNU OR CMAKE_COMPILER_IS_CLANG)
set(CMAKE_SHARED_LINKER_FLAGS "--coverage") set(CMAKE_SHARED_LINKER_FLAGS "--coverage")

View File

@ -187,6 +187,18 @@ if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code")
endif(CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_CLANG)
if(CMAKE_COMPILER_IS_MSVC)
option(MSVC_STATIC_RUNTIME "Build the libraries with /MT compiler flag" OFF)
if(MSVC_STATIC_RUNTIME)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_CHECK)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endforeach(flag_var)
endif()
endif()
if(WIN32) if(WIN32)
set(libs ${libs} ws2_32) set(libs ${libs} ws2_32)
endif(WIN32) endif(WIN32)