1 // 2 // Copyright (C) 2018 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 cc_defaults { 18 name: "swiftshader_common", 19 20 gnu_extensions: false, 21 22 cflags: [ 23 "-Xclang", "-fuse-init-array", 24 "-fno-operator-names", 25 "-msse2", 26 "-Werror", 27 "-Wwrite-strings", 28 ], 29 30 cppflags: [ 31 "-Woverloaded-virtual", 32 ], 33 cpp_std: "c++11", 34 35 target: { 36 host: { 37 cppflags: [ 38 "-fno-rtti", 39 "-fno-exceptions", 40 ], 41 compile_multilib: "64", 42 }, 43 44 // We don't need Darwin host-side builds 45 darwin: { 46 enabled: false, 47 }, 48 }, 49 } 50 51 cc_defaults { 52 name: "swiftshader_common_release", 53 54 defaults: [ "swiftshader_common" ], 55 56 cflags: [ 57 "-Os", 58 "-fomit-frame-pointer", 59 "-ffunction-sections", 60 "-fdata-sections", 61 ], 62 } 63 64 cc_defaults { 65 name: "swiftshader_common_debug", 66 67 defaults: [ "swiftshader_common" ], 68 69 cflags: [ 70 "-O0", 71 "-g", 72 "-UNDEBUG", 73 ], 74 } 75 76 cc_defaults { 77 name: "swiftshader_subzero", 78 79 cflags: [ 80 "-DALLOW_DUMP=0", 81 "-DALLOW_TIMERS=0", 82 "-DALLOW_LLVM_CL=0", 83 "-DALLOW_LLVM_IR=0", 84 "-DALLOW_LLVM_IR_AS_INPUT=0", 85 "-DALLOW_MINIMAL_BUILD=0", 86 "-DALLOW_WASM=0", 87 "-DICE_THREAD_LOCAL_HACK=1", 88 ], 89 } 90 91 cc_library_headers { 92 name: "swiftshader_platform_headers", 93 host_supported: true, 94 export_include_dirs: ["include"], 95 } 96 97 cc_library_headers { 98 name: "swiftshader_host_headers", 99 device_supported: false, 100 host_supported: true, 101 export_include_dirs: ["include/Android"], 102 } 103 104 subdirs = [ 105 "src", 106 "third_party/llvm-subzero", 107 "third_party/LLVM", 108 "third_party/subzero", 109 ] 110