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