mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user