Bug 236045

Summary: [XCBuild] Users of libgtest.a depend on headers from gtest.framework
Product: WebKit Reporter: Elliott Williams <emw>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Add headers phase in gtest static target none

Elliott Williams
Reported 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.
Attachments
Add headers phase in gtest static target (4.61 KB, patch)
2022-02-02 16:12 PST, Elliott Williams
no flags
Radar WebKit Bug Importer
Comment 1 2022-02-02 16:10:29 PST
Elliott Williams
Comment 2 2022-02-02 16:12:56 PST
Created attachment 450713 [details] Add headers phase in gtest static target
EWS
Comment 3 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].
Note You need to log in before you can comment on or make changes to this bug.