Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use CheckWarning.cmake #57

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# Get all targets in this directory
get_property(TARGETS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)

cpmaddpackage(gh:threeal/CheckWarning.cmake@1.1.0)
foreach(TARGET IN LISTS TARGETS)
# Statically analyze code by checking for warnings
if(MSVC)
target_compile_options(${TARGET} PRIVATE /WX /permissive- /W4 /w14640 /EHsc)
else()
target_compile_options(${TARGET} PRIVATE -Werror -Wall -Wextra -Wnon-virtual-dtor -Wpedantic)
endif()
target_check_warning(${TARGET})

# Enable support to check for test coverage
if(BUILD_TESTING AND NOT MSVC)
Expand Down