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 c90ac6f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
19 changes: 11 additions & 8 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 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 c90ac6f

Please sign in to comment.