jagtesh / googlemock

Automatically exported from code.google.com/p/googlemock
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

provide both /MD and /MT runtime configurations (DebugMD, ReleaseMD, DebutMT, ReleaseMT) #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In Visual C++, a common practice is to add letters to .lib file names to 
identify the runtime.  

For example if the base name is "gtest.lib" then:

gtestmd.lib  - use /MD  (multi-threaded DLL runtime)
gtestmdd.lib - use /MDd (multi-threaded debug DLL runtime)
gtestmt.lib  - use /MT  (multi-threaded runtime)
gtestmtd.lib - use /MTd (multi-threaded debug runtime)

Further, the name of each build configuration might be something like the 
following (instead of "Debug" or "Release" which are ambiguous):

DebugMD
ReleaseMD
DebugMT
ReleaseMT

Like googlemock and googletest, my preference is for /MT or /MTd. However, 
there are many cases where we are forced to use /MD or /MDd.  Please consider 
adopting the above naming conventions for the Visual C++ projects.

Plus, using such naming convention when combined with "#pragma comment(lib 
...)" statements allow cmake to easily handle both static and dll runtimes 
using a single CMakefilelist.txt.

Original issue reported on code.google.com by salvor.p...@gmail.com on 4 Mar 2011 at 9:13

GoogleCodeExporter commented 9 years ago
I noticed the MD and MT are in separate solutions.  It would be super if there 
was just one solution for MD and MT.  Then only 1 x86 and 1 x64 solution would 
be required when generating both 32-bit and 64-bit solutions using cmake.

Original comment by salvor.p...@gmail.com on 6 Mar 2011 at 6:14

GoogleCodeExporter commented 9 years ago
I'm confused by the use case. Presumably:
- You only need gtest for testing your own code.
- You have control over whether your projects link against DLL or non-DLL 
runtimes.
Given that, why would you ever need both variants for the same code base?

Original comment by ben.med...@gmail.com on 6 Mar 2011 at 10:25

GoogleCodeExporter commented 9 years ago
The VC project files are provided as a nicety.  The recommended way of using 
gmock is to use cmake or updating your existing projects with it (instructions 
in README).  Currently gmock is maintained by volunteers and we don't have the 
time/resources to keep improving the VC projects.  Sorry.

Original comment by w...@google.com on 8 Mar 2013 at 5:34