Skip to content

Commit

Permalink
build: stricter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Oct 19, 2024
1 parent f6efc7b commit 61bc279
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,21 @@ foreach(tgt ${LIBDWARFS_TARGETS} ${LIBDWARFS_OBJECT_TARGETS} dwarfs_test_helpers
target_compile_options(${tgt} PRIVATE -Wno-stringop-overflow)
endif()

if(NOT ${tgt} MATCHES "folly|fsst|thrift")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(${tgt} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>)
# target_compile_options(${tgt} PRIVATE -Wold-style-cast)
if(DWARFS_GIT_BUILD)
target_compile_options(${tgt} PRIVATE -Werror)
endif()
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(${tgt} PRIVATE -Wuseless-cast)
endif()
endif()

set_property(TARGET ${tgt} PROPERTY CXX_STANDARD 20)
set_property(TARGET ${tgt} PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET ${tgt} PROPERTY CXX_EXTENSIONS OFF)
Expand Down

0 comments on commit 61bc279

Please sign in to comment.