| 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 | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 50 | "Elf.cpp", | 
|  | 51 | "ElfInterface.cpp", | 
|  | 52 | "ElfInterfaceArm.cpp", | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 53 | "Log.cpp", | 
| Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 54 | "Regs.cpp", | 
|  | 55 | "Memory.cpp", | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 56 | ], | 
|  | 57 |  | 
|  | 58 | shared_libs: [ | 
|  | 59 | "libbase", | 
|  | 60 | "liblog", | 
|  | 61 | ], | 
|  | 62 | } | 
|  | 63 |  | 
|  | 64 | cc_library { | 
|  | 65 | name: "libunwindstack", | 
|  | 66 | defaults: ["libunwindstack_common"], | 
|  | 67 | } | 
|  | 68 |  | 
|  | 69 | cc_library { | 
|  | 70 | name: "libunwindstack_debug", | 
|  | 71 | defaults: ["libunwindstack_common"], | 
|  | 72 |  | 
|  | 73 | cflags: [ | 
|  | 74 | "-UNDEBUG", | 
|  | 75 | "-O0", | 
|  | 76 | "-g", | 
|  | 77 | ], | 
|  | 78 | } | 
|  | 79 |  | 
|  | 80 | //------------------------------------------------------------------------- | 
|  | 81 | // Unit Tests | 
|  | 82 | //------------------------------------------------------------------------- | 
|  | 83 | cc_defaults { | 
|  | 84 | name: "libunwindstack_test_common", | 
|  | 85 | defaults: ["libunwindstack_flags"], | 
|  | 86 |  | 
|  | 87 | srcs: [ | 
|  | 88 | "tests/ArmExidxDecodeTest.cpp", | 
|  | 89 | "tests/ArmExidxExtractTest.cpp", | 
| Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 90 | "tests/ElfInterfaceArmTest.cpp", | 
|  | 91 | "tests/ElfInterfaceTest.cpp", | 
|  | 92 | "tests/ElfTest.cpp", | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 93 | "tests/LogFake.cpp", | 
|  | 94 | "tests/MemoryFake.cpp", | 
|  | 95 | "tests/MemoryFileTest.cpp", | 
|  | 96 | "tests/MemoryLocalTest.cpp", | 
|  | 97 | "tests/MemoryRangeTest.cpp", | 
|  | 98 | "tests/MemoryRemoteTest.cpp", | 
|  | 99 | "tests/RegsTest.cpp", | 
|  | 100 | ], | 
|  | 101 |  | 
|  | 102 | cflags: [ | 
|  | 103 | "-O0", | 
|  | 104 | "-g", | 
|  | 105 | ], | 
|  | 106 |  | 
|  | 107 | shared_libs: [ | 
|  | 108 | "libbase", | 
|  | 109 | "liblog", | 
|  | 110 | ], | 
|  | 111 |  | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 112 | target: { | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 113 | linux: { | 
|  | 114 | host_ldlibs: [ | 
|  | 115 | "-lrt", | 
|  | 116 | ], | 
|  | 117 | }, | 
|  | 118 | }, | 
|  | 119 | } | 
|  | 120 |  | 
|  | 121 | // These unit tests run against the shared library. | 
|  | 122 | cc_test { | 
|  | 123 | name: "libunwindstack_test", | 
|  | 124 | defaults: ["libunwindstack_test_common"], | 
|  | 125 |  | 
|  | 126 | shared_libs: [ | 
|  | 127 | "libunwindstack", | 
|  | 128 | ], | 
|  | 129 | } | 
|  | 130 |  | 
|  | 131 | // These unit tests run against the static debug library. | 
|  | 132 | cc_test { | 
|  | 133 | name: "libunwindstack_test_debug", | 
|  | 134 | defaults: ["libunwindstack_test_common"], | 
|  | 135 |  | 
|  | 136 | static_libs: [ | 
|  | 137 | "libunwindstack_debug", | 
|  | 138 | ], | 
|  | 139 | } | 
| Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 140 |  | 
|  | 141 | //------------------------------------------------------------------------- | 
|  | 142 | // Utility Executables | 
|  | 143 | //------------------------------------------------------------------------- | 
|  | 144 | cc_defaults { | 
|  | 145 | name: "libunwindstack_executables", | 
|  | 146 | defaults: ["libunwindstack_flags"], | 
|  | 147 |  | 
|  | 148 | shared_libs: [ | 
|  | 149 | "libunwindstack", | 
|  | 150 | "libbase", | 
|  | 151 | ], | 
|  | 152 |  | 
|  | 153 | static_libs: [ | 
|  | 154 | "liblog", | 
|  | 155 | ], | 
|  | 156 |  | 
|  | 157 | compile_multilib: "both", | 
|  | 158 | } | 
|  | 159 |  | 
|  | 160 | cc_binary { | 
|  | 161 | name: "unwind_info", | 
|  | 162 | defaults: ["libunwindstack_executables"], | 
|  | 163 |  | 
|  | 164 | srcs: [ | 
|  | 165 | "unwind_info.cpp", | 
|  | 166 | ], | 
|  | 167 | } |