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

Enable CMake Flag -W3 as New CMP0092 no Longer Does it Implicitly #97053

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Enable CMake Flag -W3 as New CMP0092 no Longer Does it Implicitly #97053

merged 2 commits into from
Jan 17, 2024

Conversation

ivdiazsa
Copy link
Member

Resolves #96815. Starting on CMake 3.15, the warning flag -W3 is no longer added by default. We now have a minimum version of 3.20, and we would like to keep this warning enabled, so this PR addresses this.

CMP0092 no longer adds it by default, and we use it.
@ghost
Copy link

ghost commented Jan 16, 2024

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

Resolves #96815. Starting on CMake 3.15, the warning flag -W3 is no longer added by default. We now have a minimum version of 3.20, and we would like to keep this warning enabled, so this PR addresses this.

Author: ivdiazsa
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: 9.0.0

@ghost ghost assigned ivdiazsa Jan 16, 2024
Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

We already remove the /W3 flag in eng/native/configurecompiler.cmake. We can change this PR to just remove the removal.

# /W3 is added by default by CMake, so remove it
string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jan 16, 2024
configuration. So no need to add another W3, just remove that removal.
@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Jan 16, 2024
@ivdiazsa
Copy link
Member Author

Failure is unrelated and is being tracked in issue #97103. Merging this now.

@ivdiazsa ivdiazsa merged commit 15eb4df into dotnet:main Jan 17, 2024
177 of 180 checks passed
tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
…otnet#97053)

* Add universal `-W3` option to CMakeLists.txt, as the new policy
CMP0092 no longer adds it by default, and we use it.

* Had not noticed there was already a W3 removal in the compilers'
configuration. So no need to add another W3, just remove that removal.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

Enable CMake policy CMP0092 and update the corresponding compile options throughout the repo.
2 participants