dawn_features.gni: add an option to complete static libraries

This is useful for people using Dawn's standalone build to compile
static libraries to use in other projects. Without this static libraries
will act as source sets as is GN's default.

BUG=dawn:85

Change-Id: I4d99cbbbe67c73f226717651cb12ed0a172409b2
Reviewed-on: https://dawn-review.googlesource.com/c/3840
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2019-01-12 17:26:49 +00:00 committed by Commit Bot service account
parent 392b4a95c6
commit 03f64292ad
2 changed files with 7 additions and 0 deletions

View File

@ -216,6 +216,8 @@ template("dawn_static_and_shared_library") {
static_library("${libname}_static") { static_library("${libname}_static") {
output_name = libname output_name = libname
complete_static_lib = dawn_complete_static_libs
# Copy all variables except "configs", which has a default value # Copy all variables except "configs", which has a default value
forward_variables_from(invoker, "*", [ "configs" ]) forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) { if (defined(invoker.configs)) {

View File

@ -16,6 +16,11 @@ declare_args() {
# Enable Dawn's ASSERTs even in release builds # Enable Dawn's ASSERTs even in release builds
dawn_always_assert = false dawn_always_assert = false
# Should the Dawn static libraries be fully linked vs. GN's default of
# treating them as source sets. This is useful for people using Dawn
# standalone to produce static libraries to use in their projects.
dawn_complete_static_libs = false
# Enables the compilation of Dawn's D3D12 backend # Enables the compilation of Dawn's D3D12 backend
dawn_enable_d3d12 = is_win dawn_enable_d3d12 = is_win