Dan Willemsen | d3eac26 | 2017-09-08 22:47:47 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 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 | // ========================================================== |
| 18 | // Setup some common variables for the different build |
| 19 | // targets here. |
| 20 | // ========================================================== |
| 21 | |
| 22 | cc_defaults { |
| 23 | name: "split-select_defaults", |
| 24 | |
| 25 | cflags: [ |
| 26 | "-Wall", |
| 27 | "-Werror", |
| 28 | ], |
| 29 | include_dirs: ["frameworks/base/tools"], |
| 30 | static_libs: [ |
| 31 | "libaapt", |
| 32 | "libandroidfw", |
| 33 | "libpng", |
| 34 | "libutils", |
| 35 | "liblog", |
| 36 | "libcutils", |
| 37 | "libexpat", |
| 38 | "libziparchive", |
| 39 | "libbase", |
| 40 | "libz", |
| 41 | ], |
| 42 | group_static_libs: true, |
| 43 | |
| 44 | target: { |
| 45 | windows: { |
| 46 | enabled: true, |
| 47 | }, |
| 48 | }, |
| 49 | |
| 50 | // This tool is prebuilt if we're doing an app-only build. |
| 51 | product_variables: { |
| 52 | pdk: { |
| 53 | enabled: false, |
| 54 | }, |
| 55 | unbundled_build: { |
| 56 | enabled: false, |
| 57 | }, |
| 58 | }, |
| 59 | } |
| 60 | |
| 61 | // ========================================================== |
| 62 | // Build the host static library: libsplit-select |
| 63 | // ========================================================== |
| 64 | cc_library_host_static { |
| 65 | name: "libsplit-select", |
| 66 | defaults: ["split-select_defaults"], |
| 67 | |
| 68 | srcs: [ |
| 69 | "Abi.cpp", |
| 70 | "Grouper.cpp", |
| 71 | "Rule.cpp", |
| 72 | "RuleGenerator.cpp", |
| 73 | "SplitDescription.cpp", |
| 74 | "SplitSelector.cpp", |
| 75 | ], |
| 76 | cflags: ["-D_DARWIN_UNLIMITED_STREAMS"], |
| 77 | |
| 78 | } |
| 79 | |
| 80 | // ========================================================== |
| 81 | // Build the host tests: libsplit-select_tests |
| 82 | // ========================================================== |
| 83 | cc_test_host { |
| 84 | name: "libsplit-select_tests", |
| 85 | defaults: ["split-select_defaults"], |
| 86 | |
| 87 | srcs: [ |
| 88 | "Grouper_test.cpp", |
| 89 | "Rule_test.cpp", |
| 90 | "RuleGenerator_test.cpp", |
| 91 | "SplitSelector_test.cpp", |
| 92 | "TestRules.cpp", |
| 93 | ], |
| 94 | |
| 95 | static_libs: ["libsplit-select"], |
| 96 | |
| 97 | } |
| 98 | |
| 99 | // ========================================================== |
| 100 | // Build the host executable: split-select |
| 101 | // ========================================================== |
| 102 | cc_binary_host { |
| 103 | name: "split-select", |
| 104 | defaults: ["split-select_defaults"], |
| 105 | srcs: ["Main.cpp"], |
| 106 | |
| 107 | static_libs: ["libsplit-select"], |
| 108 | } |