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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken ${variant.buildType} resolution #176

Closed
athanase opened this issue Dec 11, 2023 · 2 comments
Closed

Broken ${variant.buildType} resolution #176

athanase opened this issue Dec 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@athanase
Copy link

Bug description

The variable ${variant:buildType} resolution does seem to be broken since : 60c4737

cmake_build_directory = "build/${kit}/${variant:buildType}",

${variant:buildType} is always resolved to Release even when setting the build type to Debug.

Steps to reproduce

  1. Set the build type to debug
  2. Regenerate
  3. Check build folder

Expected behavior
${variant:buildType} should be resolved to Debug if it has been selected as the build type.

Environment

  • OS: Arch linux on WSL

Additional context

@athanase athanase added the bug Something isn't working label Dec 11, 2023
@athanase athanase changed the title Broken ${variant.buildType} resolution Broken ${variant.buildType} resolution Dec 11, 2023
@Civitasv
Copy link
Owner

Civitasv commented Dec 11, 2023

I've pushed a fix. Also please attention:

And attention, when you firstly enter a new project, a session file for this project will be created, and cmake_generate_options, cmake_build_options, cmake_build_directory in your configuration will be used to initialize some fields of it. Then, if you reopen this project, it will reuse this session file to initialize these fields, or, you can think this project has its own settings, so if you change the values in global configuration, it will not reflect on these projects, you should refresh these fields by your own. Also see session docs and issue #162.

Now if you set cmake_build_directory = "out/${variant:buildType}" in global configuration, it will be saved in the session file as follow:

return {
  base_settings = {
    build_dir = "/Users/xxx/Documents/project/cmake-test/out/${variant:buildType}",
    ...
  },
  ...
}

So that it still works if you change build type. But if you change cmake_build_directory in the global configuration later, it will not reflect on this project.

@athanase
Copy link
Author

Thanks for the fix and the advice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants