blob: 01efa20d58baef20a255be0f842180a9de01602f [file] [log] [blame]
Alexis Hetu9441b072017-08-02 08:40:37 -04001# Copyright (c) 2017 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# This file contains configs that need to be added or removed to all
6# SwiftShader libraries
7
8configs_to_add = []
9configs_to_delete = []
10
11if (is_win) {
12 configs_to_delete += [ "//build/config/win:unicode" ]
13}
14
Alexis Hetu5bf72ee2017-08-10 13:52:42 -040015if (is_debug) {
16 # always build optimized version of SwiftShader for performance reasons
17 configs_to_delete += [ "//build/config/compiler:default_optimization" ]
18 configs_to_add += [ "//build/config/compiler:optimize" ]
19}
20
Alexis Hetu9441b072017-08-02 08:40:37 -040021configs_to_delete += [ "//build/config/compiler:chromium_code" ]
22configs_to_add += [
23 "//build/config/compiler:no_chromium_code",
24 "//third_party/swiftshader:swiftshader_config",
25]
26
27template("swiftshader_source_set") {
28 source_set(target_name) {
Alexis Hetu8aa07682017-08-02 17:00:55 -040029 configs -= configs_to_delete
30 configs += configs_to_add
Alexis Hetu9441b072017-08-02 08:40:37 -040031 forward_variables_from(invoker, "*", [ "configs" ])
32 if (defined(invoker.configs)) {
33 configs += invoker.configs
34 }
Alexis Hetu9441b072017-08-02 08:40:37 -040035 }
36}
37
38template("swiftshader_shared_library") {
39 shared_library(target_name) {
Alexis Hetu8aa07682017-08-02 17:00:55 -040040 configs -= configs_to_delete
41 configs += configs_to_add
Alexis Hetu9441b072017-08-02 08:40:37 -040042 forward_variables_from(invoker, "*", [ "configs" ])
43 if (defined(invoker.configs)) {
44 configs += invoker.configs
45 }
Alexis Hetu9441b072017-08-02 08:40:37 -040046 }
47}
Corentin Wallez57eb0632017-10-24 15:17:18 -040048
49template("swiftshader_static_library") {
50 static_library(target_name) {
51 configs -= configs_to_delete
52 configs += configs_to_add
53 forward_variables_from(invoker, "*", [ "configs" ])
54 if (defined(invoker.configs)) {
55 configs += invoker.configs
56 }
57 }
58}