Tom Finegan | 87fdc28 | 2017-02-10 10:30:28 -0800 | [diff] [blame] | 1 | ## |
| 2 | ## Copyright (c) 2017, Alliance for Open Media. All rights reserved |
| 3 | ## |
| 4 | ## This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | ## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | ## was not distributed with this source code in the LICENSE file, you can |
| 7 | ## obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | ## Media Patent License 1.0 was not distributed with this source code in the |
| 9 | ## PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | ## |
| 11 | |
| 12 | if (MSVC) |
| 13 | # CMake defaults to producing code linked to the DLL MSVC runtime. That will |
| 14 | # not work with googletest, and isn't what we want anyway. |
| 15 | if (NOT "${MSVC_RUNTIME}" STREQUAL "dll") |
| 16 | foreach (flag_var |
| 17 | CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
| 18 | CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO |
| 19 | CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE |
| 20 | CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) |
| 21 | if (${flag_var} MATCHES "/MD") |
| 22 | string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
| 23 | endif (${flag_var} MATCHES "/MD") |
| 24 | endforeach (flag_var) |
| 25 | endif () |
| 26 | endif () |