Skip to content

Commit 2f5524d

Browse files
build: suppress warnings in external dependencies (#131)
This PR adds compiler flags to the build process of the external dependencies downloaded and built via `FetchContent`, namely GTest and Protobuf. That build process generated more than 2k warnings in my system and, since those are well-tested external libraries, are almost certain all harmless. Signed-off-by: Ingo Müller <ingomueller@google.com>
1 parent 0fd20ad commit 2f5524d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

third_party/protobuf.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ FetchContent_Declare(Protobuf
1515
GIT_TAG v28.2
1616
OVERRIDE_FIND_PACKAGE
1717
)
18+
19+
# Disable warnings for dependency targets.
1820
set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")
21+
if(MSVC)
22+
add_compile_options("/W0")
23+
else()
24+
add_compile_options("-w")
25+
endif()
1926
FetchContent_MakeAvailable(Protobuf GTest)

0 commit comments

Comments
 (0)