Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2017 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: "libunwindstack_flags", |
| 19 | |
| 20 | host_supported: true, |
| 21 | |
| 22 | cflags: [ |
| 23 | "-Wall", |
| 24 | "-Werror", |
| 25 | "-Wextra", |
| 26 | ], |
Christopher Ferris | 01d5037 | 2017-01-30 13:45:16 -0800 | [diff] [blame] | 27 | |
| 28 | target: { |
| 29 | darwin: { |
| 30 | enabled: false, |
| 31 | }, |
| 32 | }, |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 33 | |
| 34 | multilib: { |
| 35 | lib32: { |
| 36 | suffix: "32", |
| 37 | }, |
| 38 | lib64: { |
| 39 | suffix: "64", |
| 40 | }, |
| 41 | }, |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | cc_defaults { |
| 45 | name: "libunwindstack_common", |
| 46 | defaults: ["libunwindstack_flags"], |
| 47 | |
| 48 | srcs: [ |
| 49 | "ArmExidx.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 50 | "DwarfMemory.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 51 | "DwarfOp.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 52 | "Elf.cpp", |
| 53 | "ElfInterface.cpp", |
| 54 | "ElfInterfaceArm.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 55 | "Log.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 56 | "Regs.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 57 | "Maps.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 58 | "Memory.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 59 | "Symbols.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 60 | ], |
| 61 | |
| 62 | shared_libs: [ |
| 63 | "libbase", |
| 64 | "liblog", |
| 65 | ], |
| 66 | } |
| 67 | |
| 68 | cc_library { |
| 69 | name: "libunwindstack", |
| 70 | defaults: ["libunwindstack_common"], |
| 71 | } |
| 72 | |
| 73 | cc_library { |
| 74 | name: "libunwindstack_debug", |
| 75 | defaults: ["libunwindstack_common"], |
| 76 | |
| 77 | cflags: [ |
| 78 | "-UNDEBUG", |
| 79 | "-O0", |
| 80 | "-g", |
| 81 | ], |
| 82 | } |
| 83 | |
| 84 | //------------------------------------------------------------------------- |
| 85 | // Unit Tests |
| 86 | //------------------------------------------------------------------------- |
| 87 | cc_defaults { |
| 88 | name: "libunwindstack_test_common", |
| 89 | defaults: ["libunwindstack_flags"], |
| 90 | |
| 91 | srcs: [ |
| 92 | "tests/ArmExidxDecodeTest.cpp", |
| 93 | "tests/ArmExidxExtractTest.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 94 | "tests/DwarfMemoryTest.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 95 | "tests/DwarfOpLogTest.cpp", |
| 96 | "tests/DwarfOpTest.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 97 | "tests/ElfInterfaceArmTest.cpp", |
| 98 | "tests/ElfInterfaceTest.cpp", |
| 99 | "tests/ElfTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 100 | "tests/LogFake.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 101 | "tests/MapsTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 102 | "tests/MemoryFake.cpp", |
| 103 | "tests/MemoryFileTest.cpp", |
| 104 | "tests/MemoryLocalTest.cpp", |
| 105 | "tests/MemoryRangeTest.cpp", |
| 106 | "tests/MemoryRemoteTest.cpp", |
| 107 | "tests/RegsTest.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 108 | "tests/SymbolsTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 109 | ], |
| 110 | |
| 111 | cflags: [ |
| 112 | "-O0", |
| 113 | "-g", |
| 114 | ], |
| 115 | |
| 116 | shared_libs: [ |
| 117 | "libbase", |
| 118 | "liblog", |
| 119 | ], |
| 120 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 121 | target: { |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 122 | linux: { |
| 123 | host_ldlibs: [ |
| 124 | "-lrt", |
| 125 | ], |
| 126 | }, |
| 127 | }, |
| 128 | } |
| 129 | |
| 130 | // These unit tests run against the shared library. |
| 131 | cc_test { |
| 132 | name: "libunwindstack_test", |
| 133 | defaults: ["libunwindstack_test_common"], |
| 134 | |
| 135 | shared_libs: [ |
| 136 | "libunwindstack", |
| 137 | ], |
| 138 | } |
| 139 | |
| 140 | // These unit tests run against the static debug library. |
| 141 | cc_test { |
| 142 | name: "libunwindstack_test_debug", |
| 143 | defaults: ["libunwindstack_test_common"], |
| 144 | |
| 145 | static_libs: [ |
| 146 | "libunwindstack_debug", |
| 147 | ], |
| 148 | } |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 149 | |
| 150 | //------------------------------------------------------------------------- |
| 151 | // Utility Executables |
| 152 | //------------------------------------------------------------------------- |
| 153 | cc_defaults { |
| 154 | name: "libunwindstack_executables", |
| 155 | defaults: ["libunwindstack_flags"], |
| 156 | |
| 157 | shared_libs: [ |
| 158 | "libunwindstack", |
| 159 | "libbase", |
| 160 | ], |
| 161 | |
| 162 | static_libs: [ |
| 163 | "liblog", |
| 164 | ], |
| 165 | |
| 166 | compile_multilib: "both", |
| 167 | } |
| 168 | |
| 169 | cc_binary { |
| 170 | name: "unwind_info", |
| 171 | defaults: ["libunwindstack_executables"], |
| 172 | |
| 173 | srcs: [ |
| 174 | "unwind_info.cpp", |
| 175 | ], |
| 176 | } |