Home | History | Annotate | Download | only in src
      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 
      8 configs_to_add = []
      9 configs_to_delete = []
     10 
     11 if (is_win) {
     12   configs_to_delete += [ "//build/config/win:unicode" ]
     13 }
     14 
     15 if (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 
     21 configs_to_delete += [ "//build/config/compiler:chromium_code" ]
     22 configs_to_add += [
     23   "//build/config/compiler:no_chromium_code",
     24   "//third_party/swiftshader:swiftshader_config",
     25 ]
     26 
     27 template("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 
     38 template("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