msvc_runtime.cmake: Check for MSVC, not WIN32.
- The flag change here is supposed to target only MSVC builds, and not all Windows builds. - Style tweak to match other CMake files. Change-Id: I664705e13d810e2d41422eae655b5a68ff244308
This commit is contained in:
parent
eb50da8e38
commit
2aee04fb23
@ -7,18 +7,17 @@
|
||||
## be found in the AUTHORS file in the root of the source tree.
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
if(WIN32)
|
||||
if (MSVC)
|
||||
# CMake defaults to producing code linked to the DLL MSVC runtime. In libwebm
|
||||
# static is typically desired. Force static code generation unless the user
|
||||
# running CMake set MSVC_RUNTIME to dll.
|
||||
if(NOT "${MSVC_RUNTIME}" STREQUAL "dll")
|
||||
foreach(flag_var
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
if(${flag_var} MATCHES "/MD")
|
||||
if (NOT "${MSVC_RUNTIME}" STREQUAL "dll")
|
||||
foreach (flag_var
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
if (${flag_var} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
endif(${flag_var} MATCHES "/MD")
|
||||
endforeach(flag_var)
|
||||
endif(NOT "${MSVC_RUNTIME}" STREQUAL "dll")
|
||||
endif(WIN32)
|
||||
|
||||
endif (${flag_var} MATCHES "/MD")
|
||||
endforeach (flag_var)
|
||||
endif ()
|
||||
endif ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user