Skip to content

Commit 2dd0307

Browse files
genevievehelselmeta-codesync[bot]
authored andcommitted
FBFetchFromManifest: build fetched dependencies without warnings
Summary: A project that fetches its dependencies with `fb_fetch_from_manifest()` compiles them with its own flags, so it prints every warning they have. Most of the EdenFS Linux GitHub workflow's 81,000-line Build step is warnings in fbthrift's, fb303's, wangle's, fizz's and edencommon's sources, about 2,200 of them with their notes. Fixing them is outside the scope of eden's open source build, and they bury eden's own warnings. Each dependency's own builds still report them: https://github.com/meta/sapling/actions/runs/41234051864 This builds a fetched dependency with `-w`, so it prints no more than an installed copy would. MSVC would warn about `/w` overriding the dependency's own `/W` level, so this leaves MSVC builds alone. Eden's own warnings, including those in the dependencies' headers it includes, are unchanged. ___ landed-with-radar-review Differential Revision: D128861329 fbshipit-source-id: 7e629e26f3c6722036fe34380de3f3402e260243
1 parent 02ba9dd commit 2dd0307

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎build/fbcode_builder/CMake/FBFetchFromManifest.cmake‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ function(fb_fetch_from_manifest name manifest)
138138
# Nor may its export(PACKAGE), as in cpptoml, put its build tree in the
139139
# user's package registry, where later configures would find it.
140140
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
141+
# Its warnings are for its own project to fix, and an installed copy
142+
# wouldn't print them either.
143+
if(NOT MSVC)
144+
string(APPEND CMAKE_C_FLAGS " -w")
145+
string(APPEND CMAKE_CXX_FLAGS " -w")
146+
endif()
141147
include(FetchContent)
142148
FetchContent_Declare(${name} ${source} ${ARGN} ${exclude})
143149
# CMAKE_REQUIRED_* configure this project's check_*() calls, and a

0 commit comments

Comments
 (0)