Skip to content

Add CMake option to skip monolithic library build - #2674

Open
NITIN9181 wants to merge 1 commit into
facebook:mainfrom
NITIN9181:feature/issue-2593-monolithic-build
Open

Add CMake option to skip monolithic library build#2674
NITIN9181 wants to merge 1 commit into
facebook:mainfrom
NITIN9181:feature/issue-2593-monolithic-build

Conversation

@NITIN9181

Copy link
Copy Markdown

Resolves #2593

Summary

This PR adds a FOLLY_BUILD_MONOLITHIC CMake option (defaulting to ON to preserve backward compatibility). When toggled OFF, the build system skips the assembly of the monolithic libfolly.a/libfolly.so library.

Instead, it creates an INTERFACE target named folly that aggregates all of the granular component targets (e.g., folly_io_iobuf). This ensures that downstream consumers calling target_link_libraries(... folly) continue to work without any changes, while significantly speeding up build and link times for projects that only need specific components.

Changes

  • Added FOLLY_BUILD_MONOLITHIC option to CMakeLists.txt
  • Updated folly_add_library in CMake/FollyFunctions.cmake to track all granular targets.
  • Modified folly_create_monolithic_library to create an INTERFACE target when the option is disabled, bridging the granular targets and external dependencies.

…#2593)

Provides an option to skip the assembly of the monolithic libfolly, and instead exposes an INTERFACE target named 'folly' that aggregates all the granular component targets.
@meta-cla meta-cla Bot added the CLA Signed label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No option to skip monolithic library build

1 participant