Propagation of MSVC_RUNTIME_LIBRARY target property
Is the target property MSVC_RUNTIME_LIBRARY propagated to client targets? The documentation doesn't say anything about it.
I am trying to link against MKL's static libraries, and somehow mkl_tbb_thread.lib
is built with /MD
. So when I try to link against it in a project, I am getting linking error due to mismatch between /MD
and /MDd
when I am in Debug mode. The error only happens with the Ninja generator (but the docs says that MSVC "may choose to add its own default runtime library selection flag", so maybe that's normal).
What I do is create an IMPORTED
target mkl::mkl
, and set the following property on it:
set_target_properties(mkl::mkl PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
But at link time I run into the following messages:
mkl_tbb_thread.lib(tbb_driver.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in foo.cpp.obj
Edited by Jeremie Dumas