1# 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 15if (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 21configs_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) { 29 configs -= configs_to_delete 30 configs += configs_to_add 31 forward_variables_from(invoker, "*", [ "configs" ]) 32 if (defined(invoker.configs)) { 33 configs += invoker.configs 34 } 35 } 36} 37 38template("swiftshader_shared_library") { 39 shared_library(target_name) { 40 configs -= configs_to_delete 41 configs += configs_to_add 42 forward_variables_from(invoker, "*", [ "configs" ]) 43 if (defined(invoker.configs)) { 44 configs += invoker.configs 45 } 46 } 47} 48 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} 59