Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible CLI options for VS 2019 Debug build #237

Open
burnerlee opened this issue Jan 24, 2022 · 3 comments
Open

Incompatible CLI options for VS 2019 Debug build #237

burnerlee opened this issue Jan 24, 2022 · 3 comments
Labels
bug Something isn't working devops Related to DevOps infrastructure of the Core

Comments

@burnerlee
Copy link
Contributor

馃悰 Bug Report

When building in Visual Studio 2019 in Debug mode I get this error:
image
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

  1. git clone https://github.com/metacall/core.git
  2. install VS 2019
  3. mkdir build
  4. cd build
  5. cmake ..
  6. Hit Local Windows Debugger here
    image

Context (Environment)

I was trying to build the project

@burnerlee burnerlee added the bug Something isn't working label Jan 24, 2022
@viferga
Copy link
Member

viferga commented Jan 24, 2022

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?

@burnerlee
Copy link
Contributor Author

@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

@viferga
Copy link
Member

viferga commented Jan 26, 2022

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.

@viferga viferga added the devops Related to DevOps infrastructure of the Core label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devops Related to DevOps infrastructure of the Core
Projects
None yet
Development

No branches or pull requests

2 participants