Skip to content

Commit

Permalink
Add IREE_ENABLE_WERROR_FLAG CMake option. (iree-org#16121)
Browse files Browse the repository at this point in the history
> Agree with @ Jakub Kuderski : it isn't a great default for people
using the project on random systems.
> By Stella.

Simple change to add option to disable `-Werror` flag.
  • Loading branch information
RechieKho authored Jan 16, 2024
1 parent ddccda0 commit dd17612
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ option(IREE_ENABLE_UBSAN "Enable undefined behavior sanitizer" OFF)
option(IREE_ENABLE_SPLIT_DWARF "Enable gsplit-dwarf for debug information if the platform supports it" OFF)
option(IREE_ENABLE_THIN_ARCHIVES "Enables thin ar archives (elf systems only). Disable for released static archives" OFF)
option(IREE_LINK_COMPILER_SHARED_LIBRARY "Links IREE tools using the compiler compiled into a shared library" ON)
option(IREE_ENABLE_WERROR_FLAG "Enable `-Werror` flag, treat error as warning" ON)

# STREQUAL feels wrong here - we don't care about the exact true-value used,
# ON or TRUE or something else. But we haven't been able to think of a less bad
Expand Down
4 changes: 2 additions & 2 deletions build_tools/cmake/iree_copts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS
# internally is very useful when importing. If you feel that some of these
# should be different (especially more strict), please raise an issue!
CLANG
"-Werror"
"$<$<BOOL:${IREE_ENABLE_WERROR_FLAG}>:-Werror>"
"-Wall"

"-Wno-error=deprecated-declarations" # Want to see them but defaults to error.
Expand Down Expand Up @@ -217,7 +217,7 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS

GCC
"-Wall"
"-Werror"
"$<$<BOOL:${IREE_ENABLE_WERROR_FLAG}>:-Werror>"
"-Wno-error=deprecated-declarations" # Want to see them but defaults to error.

"-Wno-address" # https://github.com/openxla/iree/issues/16016
Expand Down

0 comments on commit dd17612

Please sign in to comment.