Bug 236045 - [XCBuild] Users of libgtest.a depend on headers from gtest.framework
Summary: [XCBuild] Users of libgtest.a depend on headers from gtest.framework
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-02 16:01 PST by Elliott Williams
Modified: 2022-02-02 22:07 PST (History)
2 users (show)

See Also:


Attachments
Add headers phase in gtest static target (4.61 KB, patch)
2022-02-02 16:12 PST, Elliott Williams
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Williams 2022-02-02 16:01:48 PST
In Make-based sequential builds, we always build gtest's dynamic target (gtest.framework). This target also builds the static library (libgtest.a) as a dependency, but only copies headers to the framework (i.e. `$SRCROOT/gtest/include` is copied to `$BUILT_PRODUCT_DIR/gtest.framework/Headers`). 

When a downstream project imports a gtest header, it finds it in the framework bundle.

The problem is that WebKit never actually links against gtest.framework. All our targets which use gtest link against the static library (libgtest.a). In workspace builds, Xcode sees this and only builds gtest's static target. Our surprise dependency on the _headers_ of gtest.framework is revealed as users of gtest fail to find its headers.

Fix by making gtest's static target also produce headers.
Comment 1 Radar WebKit Bug Importer 2022-02-02 16:10:29 PST
<rdar://problem/88406549>
Comment 2 Elliott Williams 2022-02-02 16:12:56 PST
Created attachment 450713 [details]
Add headers phase in gtest static target
Comment 3 EWS 2022-02-02 22:07:51 PST
Committed r289027 (246735@main): <https://commits.webkit.org/246735@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450713 [details].