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 22package { 23 // See: http://go/android-license-faq 24 // A large-scale-change added 'default_applicable_licenses' to import 25 // all of the 'license_kinds' from "frameworks_base_license" 26 // to get the below license kinds: 27 // SPDX-license-identifier-Apache-2.0 28 default_applicable_licenses: ["frameworks_base_license"], 29} 30 31cc_defaults { 32 name: "split-select_defaults", 33 34 cflags: [ 35 "-Wall", 36 "-Werror", 37 ], 38 include_dirs: ["frameworks/base/tools"], 39 static_libs: [ 40 "libaapt", 41 "libandroidfw", 42 "libpng", 43 "libutils", 44 "liblog", 45 "libcutils", 46 "libexpat", 47 "libziparchive", 48 "libbase", 49 "libz", 50 ], 51 52 target: { 53 windows: { 54 enabled: true, 55 }, 56 }, 57 58 // This tool is prebuilt if we're doing an app-only build. 59 product_variables: { 60 pdk: { 61 enabled: false, 62 }, 63 unbundled_build: { 64 enabled: false, 65 }, 66 }, 67} 68 69// ========================================================== 70// Build the host static library: libsplit-select 71// ========================================================== 72cc_library_host_static { 73 name: "libsplit-select", 74 defaults: ["split-select_defaults"], 75 76 srcs: [ 77 "Abi.cpp", 78 "Grouper.cpp", 79 "Rule.cpp", 80 "RuleGenerator.cpp", 81 "SplitDescription.cpp", 82 "SplitSelector.cpp", 83 ], 84 cflags: ["-D_DARWIN_UNLIMITED_STREAMS"], 85 86} 87 88// ========================================================== 89// Build the host tests: libsplit-select_tests 90// ========================================================== 91cc_test_host { 92 name: "libsplit-select_tests", 93 defaults: ["split-select_defaults"], 94 95 srcs: [ 96 "Grouper_test.cpp", 97 "Rule_test.cpp", 98 "RuleGenerator_test.cpp", 99 "SplitSelector_test.cpp", 100 "TestRules.cpp", 101 ], 102 103 static_libs: ["libsplit-select"], 104 105} 106 107// ========================================================== 108// Build the host executable: split-select 109// ========================================================== 110cc_binary_host { 111 name: "split-select", 112 defaults: ["split-select_defaults"], 113 srcs: ["Main.cpp"], 114 115 static_libs: ["libsplit-select"], 116} 117