Wrap include dirs in BUILD_INTERFACE for FetchContent#2583
Closed
afrind wants to merge 1 commit into
Closed
Conversation
Summary:
When folly is consumed via FetchContent, build-tree paths in FOLLY_INCLUDE_DIRECTORIES (e.g. the fast_float include dir) leak into INTERFACE_INCLUDE_DIRECTORIES without a BUILD_INTERFACE wrapper. CMake validates these paths during generation and errors out because they're absolute build-tree paths that won't exist at install time.
Wrap each include directory individually in $<BUILD_INTERFACE:> so the paths are only used during the build and excluded from the export/install config. The foreach is necessary because $<BUILD_INTERFACE:${LIST}> doesn't expand CMake lists correctly — it only wraps the first element.
Differential Revision: D93368778
d05cc4c to
369b945
Compare
meta-codesync Bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Feb 22, 2026
Summary: X-link: facebook/folly#2583 When folly is consumed via FetchContent, build-tree paths in FOLLY_INCLUDE_DIRECTORIES (e.g. the fast_float include dir) leak into INTERFACE_INCLUDE_DIRECTORIES without a BUILD_INTERFACE wrapper. CMake validates these paths during generation and errors out because they're absolute build-tree paths that won't exist at install time. Wrap each include directory individually in $<BUILD_INTERFACE:> so the paths are only used during the build and excluded from the export/install config. The foreach is necessary because $<BUILD_INTERFACE:${LIST}> doesn't expand CMake lists correctly — it only wraps the first element. Reviewed By: yfeldblum Differential Revision: D93368778 fbshipit-source-id: 53c7763e8661f38864bab6a3d7c0829e60393f68
|
This pull request has been merged in 7eafd31. |
bolunfeng
pushed a commit
to bolunfeng/folly
that referenced
this pull request
May 22, 2026
Summary: Pull Request resolved: facebook#2583 When folly is consumed via FetchContent, build-tree paths in FOLLY_INCLUDE_DIRECTORIES (e.g. the fast_float include dir) leak into INTERFACE_INCLUDE_DIRECTORIES without a BUILD_INTERFACE wrapper. CMake validates these paths during generation and errors out because they're absolute build-tree paths that won't exist at install time. Wrap each include directory individually in $<BUILD_INTERFACE:> so the paths are only used during the build and excluded from the export/install config. The foreach is necessary because $<BUILD_INTERFACE:${LIST}> doesn't expand CMake lists correctly — it only wraps the first element. Reviewed By: yfeldblum Differential Revision: D93368778 fbshipit-source-id: 53c7763e8661f38864bab6a3d7c0829e60393f68
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:
When folly is consumed via FetchContent, build-tree paths in FOLLY_INCLUDE_DIRECTORIES (e.g. the fast_float include dir) leak into INTERFACE_INCLUDE_DIRECTORIES without a BUILD_INTERFACE wrapper. CMake validates these paths during generation and errors out because they're absolute build-tree paths that won't exist at install time.
Wrap each include directory individually in$<BUILD_INTERFACE:> so the paths are only used during the build and excluded from the export/install config. The foreach is necessary because $ <BUILD_INTERFACE:${LIST}> doesn't expand CMake lists correctly — it only wraps the first element.
Differential Revision: D93368778