Skip to content

Wrap include dirs in BUILD_INTERFACE for FetchContent#2583

Closed
afrind wants to merge 1 commit into
facebook:mainfrom
afrind:export-D93368778
Closed

Wrap include dirs in BUILD_INTERFACE for FetchContent#2583
afrind wants to merge 1 commit into
facebook:mainfrom
afrind:export-D93368778

Conversation

@afrind

@afrind afrind commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

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

@meta-cla meta-cla Bot added the CLA Signed label Feb 15, 2026
@meta-codesync

meta-codesync Bot commented Feb 15, 2026

Copy link
Copy Markdown

@afrind has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93368778.

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
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
@meta-codesync meta-codesync Bot closed this in 7eafd31 Feb 22, 2026
@meta-codesync

meta-codesync Bot commented Feb 22, 2026

Copy link
Copy Markdown

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment