Skip to content

Commit

Permalink
cpp: only enable Wall and others for GCC
Browse files Browse the repository at this point in the history
Windows uses different flags.
  • Loading branch information
bkueng committed Apr 29, 2024
1 parent 8d5c446 commit 159f83e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
37 changes: 21 additions & 16 deletions libs/cpp/parse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ include(GNUInstallDirs)
add_library(libevents_parser
parser.cpp
)
target_compile_options(libevents_parser
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(libevents_parser
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)
endif()
set_target_properties(libevents_parser PROPERTIES PUBLIC_HEADER parser.h)
install(TARGETS libevents_parser
EXPORT libevents
Expand All @@ -31,14 +34,16 @@ install(TARGETS nlohmann_json
add_library(libevents_health_and_arming_checks
health_and_arming_checks.cpp
)
target_compile_options(libevents_health_and_arming_checks
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(libevents_health_and_arming_checks
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)
endif()
set_target_properties(libevents_health_and_arming_checks PROPERTIES PUBLIC_HEADER health_and_arming_checks.h)
install(TARGETS libevents_health_and_arming_checks
EXPORT libevents
Expand Down
18 changes: 10 additions & 8 deletions libs/cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ add_custom_target(libevents_test_header DEPENDS ${generated_events_header})
add_executable(parser_test
parser.cpp
)
target_compile_options(parser_test
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(parser_test
PRIVATE
-Wall
-Wextra
-Werror
-Wconversion
-Wpedantic
)
endif()
target_link_libraries(parser_test PRIVATE
libevents_parser
GTest::gtest_main
Expand Down

0 comments on commit 159f83e

Please sign in to comment.