How can I force google test compile with /MT option? I saw that google test tries to compile with MT(internal_utils.cmake line 33):
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
endif()
But it doesn't work (BUILD_SHARED_LIBS and gtest_force_shared_crt are disabled).
I gets error when my project compiles with MT:
gtest.lib(gtest-all.obj) : error LNK2038: mismatch detected for "RuntimeLibrary": value "MD_DynamicRelease" does not match value "MT_StaticRelease"
And more some LNK2005 and LNK4217. If I try to compile my project without MT, all compiles ok. How can I solve it? Thanks in advance!
MSVC_RUNTIME_LIBRARY
, as seen in the response here. – Jerad