Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 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 | ], |
Stephen Hines | 44994a8 | 2018-11-15 17:53:50 -0800 | [diff] [blame] | 33 | cpp_std: "c++11", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 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, |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 94 | device_supported: true, |
| 95 | vendor_available: true, |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 96 | export_include_dirs: ["include"], |
| 97 | } |
| 98 | |
| 99 | cc_library_headers { |
| 100 | name: "swiftshader_host_headers", |
| 101 | device_supported: false, |
| 102 | host_supported: true, |
| 103 | export_include_dirs: ["include/Android"], |
| 104 | } |
| 105 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 106 | subdirs = [ |
| 107 | "src", |
| 108 | "third_party/llvm-subzero", |
Ben Clayton | d632e6d | 2019-04-12 16:51:47 -0400 | [diff] [blame] | 109 | "third_party/llvm-7.0", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 110 | "third_party/subzero", |
| 111 | ] |