Incompatible CLI options for VS 2019 Debug build
🐛 Bug Report
When building in Visual Studio 2019 in Debug mode I get this error:
Only happens in Debug build; Release, MinSizeRel, RelWithDebInfo build fine
Expected Behavior
The project should build fine
Current Behavior
The project did not build :(
Possible Solution
There's this: https://stackoverflow.com/a/44416270
But having /O2 for a debug build seems incorrect. Also had an issue with CLion+Linux where Debug build skipped breakpoints, which can be proof of incorrect configuration.
Steps to Reproduce
git clone https://github.com/metacall/core.git- install VS 2019
mkdir buildcd buildcmake ..- Hit Local Windows Debugger here

Context (Environment)
I was trying to build the project
This needs to be documented. Basically.. MetaCall build system depends on this flag:
cmake -DCMAKE_BUILD_TYPE=Debug ..
The default option is Release. MSVC allows you to change after generation time the build type but metacall depends on the cmake option.. so each time you want to change the build type you need to set it up and re-generate the msvc files.
Has this solved your problem? Can we close the issue?
@viferga it makes sense. But this solution seems incorrect as an IDE user would expect the configurations to work fine out of the box. Apart from Visual Studio, I had an issue in Clion where breakpoints were skipped. Now that I added the flag you mentioned, it works fine for me. So if this hack is intended, we can close this issue and I can add this to the documnentation
I just discovered that since CMake 3.11, you can set up per configuration the options! We should either check if this works: https://stackoverflow.com/a/32956785 Or this: https://stackoverflow.com/a/33831145
I think the second version may not work because generator expressions are handled at cmake generation time.
I'm leaving the issue open until it is solved.