Skip to content

Commit

Permalink
Allow for disabling all compiler warnings
Browse files Browse the repository at this point in the history
Unconditionally enabling -Werror is a heavy-handed approach and not
ideal when shipping code to be used by many third parties. For the
sake of minimizing how much I'm changing I'm still ensuring warnings
are on by default but now those building RSL have the option to
disable them entirely and thus also disable -Werror.
  • Loading branch information
ChrisThrasher committed Feb 15, 2024
1 parent cebc67c commit f636505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ find_package(rclcpp REQUIRED)
find_package(tcb_span REQUIRED)
find_package(tl_expected REQUIRED)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
option(RSL_ENABLE_WARNINGS "Enable compiler warnings" ON)
if(RSL_ENABLE_WARNINGS AND CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Werror -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wold-style-cast)
endif()

Expand Down

0 comments on commit f636505

Please sign in to comment.