epanet-dev icon indicating copy to clipboard operation
epanet-dev copied to clipboard

Debug versus Release Configurations for MSVC Compiler

Open LRossman opened this issue 9 years ago • 5 comments

The current instructions in the README.md file for building EPANET 3 using the Microsoft Visual C++ Build Tools creates a debug build of the project by default. Appending /p:Configuration=Release to the msbuild command will create a release version placed in the bin\release sub-directory. Is there any specific reason to use a debug build rather than a release one? If not, I can edit the README.md file to revise the MSVC build instructions.

LRossman avatar Sep 15 '16 21:09 LRossman

I did not have any particular reason for using a debug build, that's just what happened by default. Thus, creating a release version is fine. Specifying this in the Cmake file that might be preferable if possible, just to keep the instructions minimal.

bradleyjeck avatar Sep 16 '16 15:09 bradleyjeck

After consulting the web there apparently is nothing you can add to the CMakeLists.txt file to make it build a release version under MSVC. So I went ahead and revised the instructions in README.md to include the "Release" switch on the msbuild command line.

LRossman avatar Sep 19 '16 19:09 LRossman

i'm no windows guy, but would this be relevant? :: http://stackoverflow.com/a/20423820/787801

samhatchett avatar Sep 19 '16 20:09 samhatchett

Yes, I saw that option of adding another switch to the cmake command, but figured its no different than doing the same for msbuild. @bradleyjeck was asking if something could be done to CMakeLists.txt to create the release build without making the cmake and msbuild commands any more complicated, but it appears not.

LRossman avatar Sep 19 '16 20:09 LRossman

Looking at it a bit further, I agree the right place for that option is on the msbuild line. For visual studio cmake creates profiles for four different builds. Thus the msbuild line seems the right place to pick the configuration.

bradleyjeck avatar Sep 21 '16 09:09 bradleyjeck