Our project structured like this.
1) MainApp, it loads dlls dynamically by using boost, and all the dlls projects/modules are build with /MD.
2) Any other projects that is needed by these dlls are built as static (.lib) or dynamic (.dll) lib. There is no problem when these dependency libraries are dynamic since I can use the same MD. However, if those are static, I have to build them with MD instead of default MT, otherwise it can't be loaded in these dlls.
This has worked all the times until I am trying to compile google cloud sdk c++.
Here is the problem: Google cloud c++ sdk has many dependencies that come with the google git, BUT Google only include (or build default) the static(/MT) version. And they don't even provide options to change to MD. I can change the google cloud lib from /MT to /MD by using cmake command set(CMAKE_CXX_FLAGS_RELEASE "/MD")
, but this won't build because its dependency are /MT.
Simplified situation:
MainApp.exe dynamic loads -> Function.dll (/MD), then Function.dll static links Google_cloud.lib (.lib but with /MD), then Google_cloud.lib static link its dependencies (.lib with /MT, can't change it to /MD)
So I guess the only option is to manually custom build google cloud's static dependency with /MD and then build google cloud as static with /MD then loaded by my function.dll as static.
Any suggestion?