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

Set C11 standard in CMake examples #5014

Closed
wants to merge 1 commit into from

Conversation

hyoklee
Copy link
Member

@hyoklee hyoklee commented Oct 25, 2024

See also #4975.

@derobins derobins changed the title Set C11 standard Set C11 standard in CMake examples Oct 26, 2024
Copy link
Contributor

@byrnHDF byrnHDF left a comment

Choose a reason for hiding this comment

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

Need to determine if this is a problem for older library versions.

@@ -31,13 +31,13 @@ macro (BASIC_SETTINGS varname)
set (CMAKE_MFC_FLAG 0)
endif ()

set (CMAKE_C_STANDARD 99)
set (CMAKE_C_STANDARD 11)
Copy link
Contributor

Choose a reason for hiding this comment

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

The examples need to work for all versions of the library - should this be conditional on the lib version?

Copy link
Member

Choose a reason for hiding this comment

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

We can leave it at 99. I don't think the current examples do anything special for C11.

@@ -32,7 +32,7 @@ endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED)
if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for the library.

@fortnern fortnern closed this Oct 28, 2024
@fortnern
Copy link
Member

Closed due to consensus at standup. Examples should not require C11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants