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

fix cppstd value for msvc compiler #670

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from

Conversation

oleksandr-prykhodko-quickbase

conan settings do not support gnu versions of cppstd values in comliper.cppstd for msvc

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @oleksandr-prykhodko-quickbase

Quick question: why the CMAKE_CXX_EXTENSIONS will be defined if the compiler is msvc? That sounds like an error in the input in the first place, if the compiler is msvc that variable shouldn't be True, isn't it?

@oleksandr-prykhodko-quickbase
Copy link
Author

Thanks for your contribution @oleksandr-prykhodko-quickbase

Quick question: why the CMAKE_CXX_EXTENSIONS will be defined if the compiler is msvc? That sounds like an error in the input in the first place, if the compiler is msvc that variable shouldn't be True, isn't it?

It is indeed grey area, in the spirit of cmake and being compiler agnostic we set it ON for everything (as we do compile with different compilers). I think the question is whether this is an erroneous input: it really has no impact for msvc but is it necessarily restricted to set it ON (again in compiler agnostic world)?

@memsharded
Copy link
Member

It is indeed grey area, in the spirit of cmake and being compiler agnostic we set it ON for everything (as we do compile with different compilers). I think the question is whether this is an erroneous input: it really has no impact for msvc but is it necessarily restricted to set it ON (again in compiler agnostic world)?

Thanks for the feedback.

The approach that I have seen as recommended in different places is the one in this answer: https://stackoverflow.com/questions/48026483/setting-cmake-cxx-standard-to-various-values

if(NOT "${CMAKE_CXX_STANDARD}")
  set(CMAKE_CXX_STANDARD 11)
endif()

Because CMakeLists.txt should respect compiler-specifications defined in CMake toolchain files, and this is the correct way to default something without invalidating possible definitions.

Let's ask @jcar87 about this one.

@memsharded memsharded requested a review from jcar87 August 29, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants