| 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 | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 33 | } | 
|  | 34 |  | 
|  | 35 | cc_defaults { | 
|  | 36 | name: "libunwindstack_common", | 
|  | 37 | defaults: ["libunwindstack_flags"], | 
|  | 38 |  | 
|  | 39 | srcs: [ | 
|  | 40 | "ArmExidx.cpp", | 
|  | 41 | "Memory.cpp", | 
|  | 42 | "Log.cpp", | 
|  | 43 | ], | 
|  | 44 |  | 
|  | 45 | shared_libs: [ | 
|  | 46 | "libbase", | 
|  | 47 | "liblog", | 
|  | 48 | ], | 
|  | 49 | } | 
|  | 50 |  | 
|  | 51 | cc_library { | 
|  | 52 | name: "libunwindstack", | 
|  | 53 | defaults: ["libunwindstack_common"], | 
|  | 54 | } | 
|  | 55 |  | 
|  | 56 | cc_library { | 
|  | 57 | name: "libunwindstack_debug", | 
|  | 58 | defaults: ["libunwindstack_common"], | 
|  | 59 |  | 
|  | 60 | cflags: [ | 
|  | 61 | "-UNDEBUG", | 
|  | 62 | "-O0", | 
|  | 63 | "-g", | 
|  | 64 | ], | 
|  | 65 | } | 
|  | 66 |  | 
|  | 67 | //------------------------------------------------------------------------- | 
|  | 68 | // Unit Tests | 
|  | 69 | //------------------------------------------------------------------------- | 
|  | 70 | cc_defaults { | 
|  | 71 | name: "libunwindstack_test_common", | 
|  | 72 | defaults: ["libunwindstack_flags"], | 
|  | 73 |  | 
|  | 74 | srcs: [ | 
|  | 75 | "tests/ArmExidxDecodeTest.cpp", | 
|  | 76 | "tests/ArmExidxExtractTest.cpp", | 
|  | 77 | "tests/LogFake.cpp", | 
|  | 78 | "tests/MemoryFake.cpp", | 
|  | 79 | "tests/MemoryFileTest.cpp", | 
|  | 80 | "tests/MemoryLocalTest.cpp", | 
|  | 81 | "tests/MemoryRangeTest.cpp", | 
|  | 82 | "tests/MemoryRemoteTest.cpp", | 
|  | 83 | "tests/RegsTest.cpp", | 
|  | 84 | ], | 
|  | 85 |  | 
|  | 86 | cflags: [ | 
|  | 87 | "-O0", | 
|  | 88 | "-g", | 
|  | 89 | ], | 
|  | 90 |  | 
|  | 91 | shared_libs: [ | 
|  | 92 | "libbase", | 
|  | 93 | "liblog", | 
|  | 94 | ], | 
|  | 95 |  | 
|  | 96 | multilib: { | 
|  | 97 | lib32: { | 
|  | 98 | suffix: "32", | 
|  | 99 | }, | 
|  | 100 | lib64: { | 
|  | 101 | suffix: "64", | 
|  | 102 | }, | 
|  | 103 | }, | 
|  | 104 |  | 
|  | 105 | target: { | 
| Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 106 | linux: { | 
|  | 107 | host_ldlibs: [ | 
|  | 108 | "-lrt", | 
|  | 109 | ], | 
|  | 110 | }, | 
|  | 111 | }, | 
|  | 112 | } | 
|  | 113 |  | 
|  | 114 | // These unit tests run against the shared library. | 
|  | 115 | cc_test { | 
|  | 116 | name: "libunwindstack_test", | 
|  | 117 | defaults: ["libunwindstack_test_common"], | 
|  | 118 |  | 
|  | 119 | shared_libs: [ | 
|  | 120 | "libunwindstack", | 
|  | 121 | ], | 
|  | 122 | } | 
|  | 123 |  | 
|  | 124 | // These unit tests run against the static debug library. | 
|  | 125 | cc_test { | 
|  | 126 | name: "libunwindstack_test_debug", | 
|  | 127 | defaults: ["libunwindstack_test_common"], | 
|  | 128 |  | 
|  | 129 | static_libs: [ | 
|  | 130 | "libunwindstack_debug", | 
|  | 131 | ], | 
|  | 132 | } |