cmake: enable documentation diagnostic for clang

This commit is contained in:
Michele Caini
2022-11-16 10:23:00 +01:00
parent 82f2866789
commit 2c48cc10ae

View File

@@ -54,7 +54,16 @@ function(SETUP_TARGET TARGET_NAME)
# vs2017 emits too many false positives for my tastes
$<IF:$<EQUAL:${MSVC_TOOLSET_VERSION},141>, /W1, /W4>
# clang-cl goes a little wrong with some warnings instead
$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","Clang">:-Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unknown-warning-option -Wno-exceptions -Wno-unused-local-typedef -Wno-unused-private-field>
$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","Clang">:
-Wno-deprecated-declarations
-Wno-ignored-qualifiers
-Wno-unknown-warning-option
-Wno-exceptions
-Wno-unused-local-typedef
-Wno-unused-private-field
>
# documentation diagnostic on also for clang-cl
$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","Clang">:-Wdocumentation>
/EHsc /wd4324 /wd4996
$<$<CONFIG:Debug>:/Od>
$<$<CONFIG:Release>:/O2>
@@ -64,6 +73,7 @@ function(SETUP_TARGET TARGET_NAME)
${TARGET_NAME}
PRIVATE
-pedantic -fvisibility=hidden -Wall -Wshadow -Wno-deprecated-declarations
$<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","Clang">:-Wdocumentation>
$<$<CONFIG:Debug>:-O0 -g>
$<$<CONFIG:Release>:-O2>
)