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

[bug]preprocessor_definitions.Release["XXX"] = None generate not corrext #15753

Closed
peterpuppy opened this issue Feb 26, 2024 · 3 comments · Fixed by #15756
Closed

[bug]preprocessor_definitions.Release["XXX"] = None generate not corrext #15753

peterpuppy opened this issue Feb 26, 2024 · 3 comments · Fixed by #15756
Assignees

Comments

@peterpuppy
Copy link

Environment details

  • Operating System+version:windows11
  • Compiler+version: vc142
  • Conan version: 2.1
  • Python version:3.8
    tc.preprocessor_definitions[f"PROFILE"] = None

Steps to reproduce

in conanfile.py

tc.preprocessor_definitions[f"PROFILE"] = None

conan install in toolchain file

# Preprocessor definitions per configuration
set(CONAN_DEF_ReleaseRelease "None")
add_compile_definitions(Release=$<IF:$<CONFIG:Release>,${CONAN_DEF_ReleaseRelease},"">)

Logs

No response

@memsharded memsharded self-assigned this Feb 26, 2024
@memsharded
Copy link
Member

Hi @peterpuppy

Thanks for your report.

We have a test in our suite that tests this in

tc.preprocessor_definitions["NOVALUE_DEF"] = None

It seems it is generating the correct toolchain.cmake code:

add_compile_definitions("NOVALUE_DEF")

And the C++ code is correctly using it:

#ifdef NOVALUE_DEF
            printf("NO VALUE!!!!");
#endif

So I'd say this is working fine.

@memsharded
Copy link
Member

It seems that the issue could be related to using tc.preprocessor_definitions.release[f"PROFILE"] = None, with using the .<config>. I have doing some improvements in #15756 that would fix this issue, and it will be included in next 2.2 release

@peterpuppy
Copy link
Author

yes it's.

tc.preprocessor_definitions.release[f"PROFILE"] = None

my mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants