Fix CMake BUILD_SHARED_LIBS=ON support#601
Closed
afrind wants to merge 1 commit intofacebook:mainfrom
Closed
Conversation
Summary: The granular CMake refactoring in D91009064 broke shared library builds. 1. `proxygen_add_library()` creates INTERFACE targets for shared builds, but `lib/CMakeLists.txt` called `target_include_directories(... PUBLIC ...)` on them. CMake only allows INTERFACE properties on INTERFACE targets. These calls were redundant since `proxygen_add_library()` already sets the same include directories. 2. In `proxygen_resolve_deferred_dependencies()`, `_obj` targets could fall through to linking against plain INTERFACE wrapper targets, which link to the monolithic `proxygen` shared library. Since `proxygen` is built from those same `_obj` targets, this creates a dependency cycle. Skip deps without an `_obj` version for `_obj` targets in shared builds. Differential Revision: D96253183
|
This pull request has been merged in 6c8097b. |
meta-codesync bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Mar 12, 2026
Summary: X-link: facebook/proxygen#601 The granular CMake refactoring in D91009064 broke shared library builds. 1. `proxygen_add_library()` creates INTERFACE targets for shared builds, but `lib/CMakeLists.txt` called `target_include_directories(... PUBLIC ...)` on them. CMake only allows INTERFACE properties on INTERFACE targets. These calls were redundant since `proxygen_add_library()` already sets the same include directories. 2. In `proxygen_resolve_deferred_dependencies()`, `_obj` targets could fall through to linking against plain INTERFACE wrapper targets, which link to the monolithic `proxygen` shared library. Since `proxygen` is built from those same `_obj` targets, this creates a dependency cycle. Skip deps without an `_obj` version for `_obj` targets in shared builds. Reviewed By: jbeshay Differential Revision: D96253183 fbshipit-source-id: 1b0a1728c014b8475834e31ff09bbed7bd912948
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The granular CMake refactoring in D91009064 broke shared library builds.
proxygen_add_library()creates INTERFACE targets for shared builds, butlib/CMakeLists.txtcalledtarget_include_directories(... PUBLIC ...)onthem. CMake only allows INTERFACE properties on INTERFACE targets. These
calls were redundant since
proxygen_add_library()already sets the sameinclude directories.
In
proxygen_resolve_deferred_dependencies(),_objtargets could fallthrough to linking against plain INTERFACE wrapper targets, which link to
the monolithic
proxygenshared library. Sinceproxygenis built fromthose same
_objtargets, this creates a dependency cycle. Skip depswithout an
_objversion for_objtargets in shared builds.Differential Revision: D96253183