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

Detect compiler.cppstd from CMAKE_CXX_STANDARD #343

Merged
merged 3 commits into from
Nov 16, 2021

Conversation

guy-david
Copy link
Contributor

Conan dependencies do not share the same CMAKE_CXX_STANDARD set by a user in a parent project.

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2021

CLA assistant check
All committers have signed the CLA.

@guy-david
Copy link
Contributor Author

ping.

@czoido
Copy link
Contributor

czoido commented Oct 6, 2021

Hi @guy-david,
Sorry for not answering before and thanks for the contribution.
I think this could be also addressed without changes setting the compiler.cppstd in the call to conan_cmake_install like:

conan_cmake_configure(REQUIRES fmt/6.1.2 
                      GENERATORS cmake_find_package)

conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE .
                    BUILD missing
                    REMOTE conancenter
                    SETTINGS ${settings}
                    SETTINGS compiler.cppstd=${CMAKE_CXX_STANDARD})

@guy-david
Copy link
Contributor Author

That's true, however this change is not a feature.
The current default behaviour can build dependencies with the wrong C++ standard level, which are not all ABI compatible, leading to a segmentation fault.

@czoido
Copy link
Contributor

czoido commented Oct 13, 2021

That's true, however this change is not a feature. The current default behaviour can build dependencies with the wrong C++ standard level, which are not all ABI compatible, leading to a segmentation fault.

@guy-david Yes, this totally makes sense, I'll add a test and approve once the ci passes. Thanks for the contribution

@czoido czoido added this to the 0.17 milestone Nov 16, 2021
@czoido czoido merged commit 9dcc51d into conan-io:develop Nov 16, 2021
@guy-david guy-david deleted the compiler-cpp-standard branch November 17, 2021 13:39
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.

3 participants