Colin Cross | d3b6bc7 | 2016-07-13 14:01:45 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2015 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: "relocation_packer_flags", |
Chih-Hung Hsieh | 84f0dcd | 2017-10-02 11:47:31 -0700 | [diff] [blame] | 19 | cflags: [ |
Colin Cross | d3b6bc7 | 2016-07-13 14:01:45 -0700 | [diff] [blame] | 20 | "-Wall", |
Chih-Hung Hsieh | 84f0dcd | 2017-10-02 11:47:31 -0700 | [diff] [blame] | 21 | "-Werror", |
| 22 | ], |
| 23 | cppflags: [ |
Colin Cross | d3b6bc7 | 2016-07-13 14:01:45 -0700 | [diff] [blame] | 24 | "-Wextra", |
| 25 | "-Wunused", |
Colin Cross | d3b6bc7 | 2016-07-13 14:01:45 -0700 | [diff] [blame] | 26 | "-Wold-style-cast", |
| 27 | ], |
| 28 | |
| 29 | target: { |
| 30 | darwin: { |
| 31 | enabled: false, |
| 32 | }, |
| 33 | }, |
| 34 | } |
| 35 | |
| 36 | cc_library_host_static { |
| 37 | name: "lib_relocation_packer", |
| 38 | defaults: ["relocation_packer_flags"], |
| 39 | srcs: [ |
| 40 | "src/debug.cc", |
| 41 | "src/delta_encoder.cc", |
| 42 | "src/elf_file.cc", |
| 43 | "src/packer.cc", |
| 44 | "src/sleb128.cc", |
| 45 | ], |
| 46 | |
| 47 | static_libs: [ |
| 48 | "libelf", |
| 49 | "libz", |
| 50 | ], |
| 51 | } |
| 52 | |
| 53 | cc_binary_host { |
| 54 | name: "relocation_packer", |
| 55 | defaults: ["relocation_packer_flags"], |
| 56 | |
| 57 | srcs: ["src/main.cc"], |
| 58 | static_libs: [ |
| 59 | "lib_relocation_packer", |
| 60 | "libelf", |
| 61 | "libz", |
| 62 | "libbase", |
| 63 | ], |
| 64 | |
| 65 | // Statically linking libc++ to make it work from prebuilts |
| 66 | stl: "libc++_static", |
| 67 | } |
| 68 | |
| 69 | cc_test_host { |
| 70 | name: "relocation_packer_unit_tests", |
| 71 | defaults: ["relocation_packer_flags"], |
| 72 | |
| 73 | srcs: [ |
| 74 | "src/debug_unittest.cc", |
| 75 | "src/delta_encoder_unittest.cc", |
| 76 | "src/elf_file_unittest.cc", |
| 77 | "src/sleb128_unittest.cc", |
| 78 | "src/packer_unittest.cc", |
| 79 | ], |
| 80 | |
| 81 | static_libs: [ |
| 82 | "lib_relocation_packer", |
| 83 | "libelf", |
| 84 | "libz", |
| 85 | ], |
| 86 | } |