KEMBAR78
Change -Werror handling. by hvdijk · Pull Request #293 · oneapi-src/level-zero · GitHub
Skip to content

Conversation

@hvdijk
Copy link
Contributor

@hvdijk hvdijk commented Mar 10, 2025

  • If building level_zero as a subproject, do not build with warnings as errors, leave it up to the parent project to turn these into errors if desired.
  • If building level_zero with CMake 3.24 or newer, use CMAKE_COMPILE_WARNING_AS_ERROR instead of explicitly setting -Werror. This permits users to turn it off with cmake --compile-no-warning-as-error.

In both cases, being able to disable -Werror is useful when a parent project or a user wishes to turn on additional warnings that should not be turned into errors.

* If building level_zero as a subproject, do not build with warnings as
  errors, leave it up to the parent project to turn these into errors if
  desired.
* If building level_zero with CMake 3.24 or newer, use
  CMAKE_COMPILE_WARNING_AS_ERROR instead of explicitly setting -Werror.
  This permits users to turn it off with `cmake
  --compile-no-warning-as-error`.

In both cases, being able to disable -Werror is useful when a parent
project or a user wishes to turn on additional warnings that should not
be turned into errors.

Signed-off-by: Harald van Dijk <harald.vandijk@codeplay.com>
@hvdijk
Copy link
Contributor Author

hvdijk commented Mar 10, 2025

This came up when trying to build DPC++ with additional warnings, in order to see where those would trigger in other parts of DPC++. The build just completely broke because of the -Werror in level zero, I hope it is acceptable to have a way to turn it off like this.

@nrspruit nrspruit merged commit d1baac0 into oneapi-src:master Mar 10, 2025
49 checks passed
@hvdijk hvdijk deleted the compile-warning-as-error branch March 17, 2025 11:44
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