Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 1 | // Copyright (C) 2016 The Android Open Source Project |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Redistribution and use in source and binary forms, with or without |
| 5 | // modification, are permitted provided that the following conditions |
| 6 | // are met: |
| 7 | // * Redistributions of source code must retain the above copyright |
| 8 | // notice, this list of conditions and the following disclaimer. |
| 9 | // * Redistributions in binary form must reproduce the above copyright |
| 10 | // notice, this list of conditions and the following disclaimer in |
| 11 | // the documentation and/or other materials provided with the |
| 12 | // distribution. |
| 13 | // |
| 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 15 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 16 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 17 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 18 | // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 19 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 20 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 21 | // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 22 | // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 23 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 24 | // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 25 | // SUCH DAMAGE. |
| 26 | // |
| 27 | // |
| 28 | // Copyright (c) 2016 VIXL authors |
| 29 | // All rights reserved. |
| 30 | // |
| 31 | // Redistribution and use in source and binary forms, with or without |
| 32 | // modification, are permitted provided that the following conditions |
| 33 | // are met: |
| 34 | // 1. Redistributions of source code must retain the above copyright |
| 35 | // notice, this list of conditions and the following disclaimer. |
| 36 | // 2. Redistributions in binary form must reproduce the above copyright |
| 37 | // notice, this list of conditions and the following disclaimer in the |
| 38 | // documentation and/or other materials provided with the distribution. |
| 39 | // 3. The name of the company may not be used to endorse or promote |
| 40 | // products derived from this software without specific prior written |
| 41 | // permission. |
| 42 | // |
| 43 | // THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 44 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 45 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 46 | // IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 47 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
| 48 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 49 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 50 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 51 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 52 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 53 | |
| 54 | cc_defaults { |
| 55 | name: "vixl-common", |
| 56 | host_supported: true, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 57 | srcs: ["src/*.cc"], |
| 58 | clang_cflags: ["-Wimplicit-fallthrough"], |
| 59 | cppflags: [ |
| 60 | "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0", |
| 61 | "-Wall", |
| 62 | "-Wextra", |
| 63 | "-Werror", |
| 64 | "-fdiagnostics-show-option", |
| 65 | "-Wredundant-decls", |
| 66 | "-Wunreachable-code", |
| 67 | "-Wmissing-noreturn", |
| 68 | "-pedantic", |
| 69 | "-std=c++11", |
| 70 | |
| 71 | // Explicitly enable the write-strings warning. VIXL uses |
| 72 | // const correctly when handling string constants. |
| 73 | "-Wwrite-strings", |
| 74 | ], |
| 75 | local_include_dirs: ["src"], |
| 76 | native_coverage: false, |
| 77 | sanitize: { |
| 78 | recover: ["shift-exponent"], |
| 79 | }, |
| 80 | } |
| 81 | |
| 82 | cc_defaults { |
| 83 | name: "vixl-arm", |
| 84 | defaults: ["vixl-common"], |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 85 | cppflags: [ |
| 86 | "-DVIXL_CODE_BUFFER_MALLOC", |
Scott Wakeling | 25e9a7a | 2017-01-23 15:51:39 +0000 | [diff] [blame] | 87 | "-DVIXL_INCLUDE_TARGET_T32", |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 88 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 89 | srcs: ["src/aarch32/*.cc"], |
| 90 | } |
| 91 | |
| 92 | cc_defaults { |
| 93 | name: "vixl-arm64", |
| 94 | defaults: ["vixl-common"], |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 95 | cppflags: [ |
| 96 | "-DVIXL_INCLUDE_SIMULATOR_AARCH64", |
| 97 | "-DVIXL_CODE_BUFFER_MMAP", |
Scott Wakeling | 25e9a7a | 2017-01-23 15:51:39 +0000 | [diff] [blame] | 98 | "-DVIXL_INCLUDE_TARGET_A64", |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 99 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 100 | srcs: ["src/aarch64/*.cc"], |
| 101 | } |
| 102 | |
| 103 | cc_defaults { |
| 104 | name: "vixl-debug", |
| 105 | defaults: ["vixl-common"], |
| 106 | cppflags: [ |
| 107 | "-DVIXL_DEBUG", |
| 108 | "-UNDEBUG", |
| 109 | |
| 110 | "-O2", |
| 111 | "-ggdb3", |
| 112 | ], |
| 113 | } |
| 114 | |
| 115 | cc_defaults { |
| 116 | name: "vixl-release", |
| 117 | defaults: ["vixl-common"], |
| 118 | cppflags: [ |
| 119 | "-O3", |
| 120 | ], |
| 121 | } |
| 122 | |
| 123 | cc_library { |
| 124 | name: "libvixl-arm64", |
| 125 | defaults: ["vixl-release", "vixl-arm64"], |
Justin Yun | 5a5a179 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 126 | vendor_available: true, |
| 127 | vndk: { |
| 128 | enabled: true, |
| 129 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | cc_library { |
| 133 | name: "libvixld-arm64", |
| 134 | defaults: ["vixl-debug", "vixl-arm64"], |
| 135 | } |
| 136 | |
| 137 | cc_library { |
| 138 | name: "libvixl-arm", |
| 139 | defaults: ["vixl-release", "vixl-arm"], |
Justin Yun | 5a5a179 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 140 | vendor_available: true, |
| 141 | vndk: { |
| 142 | enabled: true, |
| 143 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | cc_library { |
| 147 | name: "libvixld-arm", |
| 148 | defaults: ["vixl-debug", "vixl-arm"], |
| 149 | } |
| 150 | |
| 151 | //######## VIXL HOST TESTS ######### |
| 152 | // |
| 153 | // We only support 64bit host builds for now. |
| 154 | // To run all the tests: vixl-test-runner --run_all |
| 155 | // |
| 156 | cc_binary_host { |
| 157 | name: "vixl-test-runner", |
| 158 | static_executable: true, |
| 159 | defaults: ["vixl-debug", "vixl-arm", "vixl-arm64"], |
| 160 | local_include_dirs: ["test"], |
| 161 | srcs: [ |
| 162 | "test/*.cc", |
| 163 | "test/aarch32/*.cc", |
| 164 | "test/aarch64/*.cc", |
| 165 | ], |
| 166 | enabled: false, |
| 167 | target: { |
| 168 | linux_x86_64: { |
| 169 | enabled: true, |
| 170 | }, |
| 171 | }, |
| 172 | } |