CMake : Improve handling of compiler flags (#8486)

#8478 Code cleanup to fix some warnings

Several adjustments to improve the specification and usage of compile flags.
This commit is contained in:
Magne Sjaastad
2022-01-26 10:08:28 +01:00
committed by GitHub
parent d5b17976ed
commit 2d2bf0bbc7
24 changed files with 190 additions and 64 deletions
+7 -6
View File
@@ -231,13 +231,14 @@ target_include_directories(${PROJECT_NAME} PUBLIC
target_link_libraries(${PROJECT_NAME} PRIVATE ${_LINK_LIBRARIES})
if(MSVC)
# GRPC generates a lot of harmless warnings on MSVC
set_target_properties(
${PROJECT_NAME}
PROPERTIES COMPILE_FLAGS "/wd4251 /wd4702 /wd4005 /wd4244 /wd4125 /wd4267")
target_compile_options(
GrpcInterface
PRIVATE /wd4251 /wd4244 /wd4267)
else()
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
"-Wno-overloaded-virtual")
target_compile_options(
GrpcInterface
PRIVATE -Wno-switch -Wno-overloaded-virtual
)
endif()
# install gRPC Python files