Skip to content

Conversation

@memsharded
Copy link
Member

Changelog: (Feature | Fix | Bugfix): Describe here your pull request
Docs: https://github.com/conan-io/docs/pull/XXXX

Close #18613

@memsharded
Copy link
Member Author

A ConanCenter recipe would look like:

            #if is_msvc(self):
                # Required for the __cplusplus check at
                # https://github.com/DCMTK/dcmtk/blob/DCMTK-3.6.8/config/include/dcmtk/config/osconfig.h.in#L1489
            #    self.cpp_info.components[target_lib].cxxflags.append("/Zc:__cplusplus")
            def myflags(consumer):
                if consumer.settings.get_safe("compiler") == "msvc":
                    return ["/Zc:__cplusplus"]
            self.cpp_info.components[target_lib].cxxflags = myflags

@memsharded
Copy link
Member Author

With new changes, the recipe in ConanCenter could be just:

self.cpp_info.cxxflags = lambda c: ["/Zc:__cplusplus"] if is_msvc(c) else []

And fully transparent to the consumers

@memsharded memsharded added this to the 2.22.0 milestone Sep 24, 2025
@memsharded memsharded requested a review from jcar87 October 15, 2025 12:21
@czoido czoido modified the milestones: 2.22.0, 2.23.0 Oct 29, 2025
…in both contexts with different settings (conan-io#19208)

* Add failing test for compat when different context reuires different packages

potential path forward

What?

Maybe

simplify test

make test valid in windows too

Bump version

* This also fails with update

* fixes

* fixes

* Simplify

---------

Co-authored-by: memsharded <[email protected]>
@memsharded memsharded modified the milestones: 2.23.0, 2.24.0 Nov 25, 2025
@memsharded memsharded modified the milestones: 2.24.0, 2.25.0 Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feedback] compatibility can't handle cpp_info cxxflags

3 participants