Jan Tattermusch | 5140791 | 2017-02-02 20:44:22 +0100 | [diff] [blame] | 1 | option(gRPC_MSVC_STATIC_RUNTIME "Link with static msvc runtime libraries" OFF) |
| 2 | |
| 3 | if(gRPC_MSVC_STATIC_RUNTIME) |
| 4 | # switch from dynamic to static linking of msvcrt |
| 5 | foreach(flag_var |
| 6 | CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE |
| 7 | CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) |
| 8 | |
| 9 | if(${flag_var} MATCHES "/MD") |
| 10 | string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
| 11 | endif(${flag_var} MATCHES "/MD") |
| 12 | endforeach(flag_var) |
| 13 | endif() |
| 14 | |