New issue
Advanced search Search tips

Issue 710334 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

GN cannot build static_library that only depends on a source_set on OSX or Windows

Project Member Reported by pwnall@chromium.org, Apr 11 2017

Issue description

Patch demonstrating the issue: https://codereview.chromium.org/2808293002/

The GN toolchain definition used on OSX and Windows fails to build a static_library whose only dependency is a source_set. The source_set is populated. Adding at least one source to the static_library will get the build to succeed.

What steps will reproduce the problem?
(1) Patch in the following CL: https://codereview.chromium.org/2808293002/
(2) Do a build

What is the expected result?

The build succeeds.

What happens instead?

The build fails on OSX and Windows. The trybot results show the errors.
 
Owner: pwnall@chromium.org
Status: Assigned (was: Untriaged)
Dependending on what you're trying to do, either you're doing something you shouldn't be doing, or you should use `complete_static_lib = true` in your target. See the documentation for more, but basically you're asking the toolchain to create empty libraries and they don't like that.

As a side note, we should probably improve the documentation for static_library() to make this clearer and link to complete_static_lib more prominently.

Comment 2 by pwnall@chromium.org, Apr 11 2017

You're right :) Thank you very much for pointing me to complete_static_lib!

I expected that the complete_static_lib behavior would be the default. In my mental model, source_set was a macro, and static_library materialized all source_sets.

Perhaps it'd be worth adding/moving the first paragraph / first two paragraphs from the complete_static_lib doc to the static_lib doc?

Sign in to add a comment