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

chore: More reliable definition of C standard in CMakeLists #605

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

paleolimbot
Copy link
Member

Some local update on my local machine resulted in nanoarrow not compiling because clang gave a warning for the C11 extensions in the flatcc generated code. I believe this was because the C standard had already been set to C99 at the beginning of the file, whereas the check to update it to C11 only happened after this had already been set.

@paleolimbot paleolimbot marked this pull request as ready for review September 7, 2024 03:46
Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

Hm, the value of CMAKE_C_STANDARD is used when a new target is created to initialize the relevant target property. So your existing code should have worked, as afaik the variable is not immutable once set. Could it just have been a case of needing to clean the build tree?

Your solution looks ok otherwise, so if this works in your local case 🤷

@paleolimbot
Copy link
Member Author

My therory was that the if(NOT DEFINED CMAKE_C_STANDARD) had prevented it from being updated to 11 after being set to 99 early on (but 🤷 )!

@paleolimbot paleolimbot merged commit 567748d into apache:main Sep 11, 2024
22 checks passed
@assignUser
Copy link
Member

Oh yeah 🤦 true!

@paleolimbot paleolimbot deleted the cmake-c-standard branch September 14, 2024 03:38
@paleolimbot paleolimbot added this to the nanoarrow 0.6.0 milestone Sep 17, 2024
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