vcmi / vcmi

Open-source engine for Heroes of Might and Magic III
https://vcmi.eu/
GNU General Public License v2.0
4.2k stars 462 forks source link

Debug configuration not working on Windows #1696

Open krs0 opened 1 year ago

krs0 commented 1 year ago

Alongside DebugWithRelInfo fix also Debug configuration for MSVC

Additional context Some things are just not debuggable with DebugWithRelInfo

rilian-la-te commented 1 year ago

@krs0 msvc or mingw? Please, add answer into bug description.

kambala-decapitator commented 1 year ago

and what does "not working" exactly mean? :)

krs0 commented 1 year ago

@IvanSavenko sugested to add to \source\CMakeLists.txt

    if(MSVC)
        set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")

But this is not the complete solution. The following error occurs now:

image

kambala-decapitator commented 1 year ago

is this file present in the vcpkg archive?

krs0 commented 1 year ago

@kambala-decapitator ...\vcpkg\installed\x64-windows\lib\tbb12.lib

kambala-decapitator commented 1 year ago
  1. you should be using vcpkg\installed\x64-windows\debug\... for Debug build and such file doesn't exist there
  2. probably CML needs to be adjusted to look for tbb12_debug.lib file
IvanSavenko commented 1 year ago

@kambala-decapitator MSVC Debug libraries are useless for something more complex than helloworld krs is using option set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") Which should link to "release" libraries in every configuration.

This should allow reasonable performance of Debug configuration of vcmi and still be usable for debugging since vcmi binaries are not optimized.

kambala-decapitator commented 1 year ago

then vcpkg must not use debug directory to search for libraries

nullkiller commented 1 year ago

You can put the lib manually there to output directory once. Some vcpkg just can not understand correctly these combined targets like RelWithDebInfo because it either have check BuildType=Release or BuildType=Debug so using them there is a bit dangerous

DjWarmonger commented 1 year ago

Quick fix: Replace the library manually in source\bin\Debug folder.