Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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: "linkerconfig_defaults", |
| 19 | cflags: [ |
| 20 | "-Wall", |
| 21 | "-Werror", |
| 22 | "-Wextra", |
| 23 | ], |
| 24 | static_libs: [ |
| 25 | "libbase", |
| 26 | "liblog", |
Jooyung Han | 33a9505 | 2019-12-06 19:47:30 +0900 | [diff] [blame] | 27 | "libprotobuf-cpp-lite", |
| 28 | "lib_apex_manifest_proto_lite", |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 29 | ], |
Jooyung Han | a3d5d09 | 2019-09-26 23:23:50 +0900 | [diff] [blame] | 30 | host_supported: true, |
Kiyoung Kim | 09cbb08 | 2019-12-05 16:44:34 +0900 | [diff] [blame] | 31 | recovery_available: true, |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 32 | } |
| 33 | |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 34 | cc_defaults { |
| 35 | name: "linkerconfig_test_defaults", |
| 36 | defaults: ["linkerconfig_defaults"], |
| 37 | cflags: [ |
| 38 | "-g", |
| 39 | "-Wunused", |
| 40 | ], |
| 41 | test_suites: ["general-tests"], |
Kiyoung Kim | 09cbb08 | 2019-12-05 16:44:34 +0900 | [diff] [blame] | 42 | recovery_available: false, |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 43 | } |
| 44 | |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 45 | cc_library_static { |
| 46 | name: "linkerconfig_modules", |
| 47 | defaults: [ "linkerconfig_defaults" ], |
Kiyoung Kim | ff9cbf7 | 2019-03-14 18:26:24 +0900 | [diff] [blame] | 48 | export_include_dirs: [ "modules/include" ], |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 49 | srcs: [ |
| 50 | "modules/*.cc", |
| 51 | ], |
| 52 | } |
| 53 | |
Kiyoung Kim | ff9cbf7 | 2019-03-14 18:26:24 +0900 | [diff] [blame] | 54 | cc_library_static { |
| 55 | name: "linkerconfig_contents", |
| 56 | defaults: [ "linkerconfig_defaults" ], |
| 57 | export_include_dirs: [ "contents/include" ], |
| 58 | static_libs: [ |
| 59 | "linkerconfig_modules", |
| 60 | ], |
| 61 | srcs: [ |
| 62 | "contents/namespace/*.cc", |
| 63 | "contents/section/*.cc", |
| 64 | "contents/configuration/*.cc", |
| 65 | "contents/context/*.cc", |
Martin Stjernholm | cb9df4f | 2019-10-02 20:47:12 +0100 | [diff] [blame] | 66 | "contents/common/*.cc", |
Kiyoung Kim | ff9cbf7 | 2019-03-14 18:26:24 +0900 | [diff] [blame] | 67 | ], |
| 68 | } |
| 69 | |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 70 | cc_library_static { |
| 71 | name: "linkerconfig_generator", |
| 72 | defaults : [ "linkerconfig_defaults" ], |
| 73 | export_include_dirs: [ "generator/include" ], |
Kiyoung Kim | e9a77fe | 2019-05-23 11:04:20 +0900 | [diff] [blame] | 74 | static_libs: [ |
| 75 | "linkerconfig_modules", |
| 76 | "linkerconfig_contents", |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 77 | "libc++fs", |
Kiyoung Kim | e9a77fe | 2019-05-23 11:04:20 +0900 | [diff] [blame] | 78 | ], |
| 79 | srcs: [ |
| 80 | "generator/*.cc", |
Kiyoung Kim | 15e3835 | 2019-07-11 17:07:03 +0900 | [diff] [blame] | 81 | ], |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | cc_binary { |
| 85 | name: "linkerconfig", |
| 86 | defaults: [ "linkerconfig_defaults" ], |
| 87 | static_libs: [ |
| 88 | "linkerconfig_modules", |
| 89 | "linkerconfig_contents", |
| 90 | "linkerconfig_generator", |
| 91 | ], |
| 92 | srcs: [ |
| 93 | "main.cc", |
| 94 | ], |
Kiyoung Kim | 15e3835 | 2019-07-11 17:07:03 +0900 | [diff] [blame] | 95 | static_executable: true, |
Kiyoung Kim | e9a77fe | 2019-05-23 11:04:20 +0900 | [diff] [blame] | 96 | } |
| 97 | |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 98 | cc_test { |
| 99 | name: "linkerconfig_modules_unittest", |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 100 | defaults: [ "linkerconfig_test_defaults" ], |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 101 | srcs: [ |
| 102 | "modules/tests/*_test.cc", |
| 103 | ], |
| 104 | static_libs: [ |
Jooyung Han | 33a9505 | 2019-12-06 19:47:30 +0900 | [diff] [blame] | 105 | "libgmock", |
Kiyoung Kim | 7d422b3 | 2019-03-05 17:06:13 +0900 | [diff] [blame] | 106 | "linkerconfig_modules", |
| 107 | ], |
Kiyoung Kim | ff9cbf7 | 2019-03-14 18:26:24 +0900 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | cc_test { |
| 111 | name: "linkerconfig_backward_compatibility_test", |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 112 | defaults: [ "linkerconfig_test_defaults" ], |
Kiyoung Kim | ff9cbf7 | 2019-03-14 18:26:24 +0900 | [diff] [blame] | 113 | srcs: [ |
| 114 | "contents/tests/backward_compatibility/*_test.cc", |
| 115 | ], |
| 116 | static_libs: [ |
| 117 | "linkerconfig_modules", |
| 118 | "linkerconfig_contents", |
| 119 | ], |
Kiyoung Kim | 15e3835 | 2019-07-11 17:07:03 +0900 | [diff] [blame] | 120 | } |
Kiyoung Kim | 853438d | 2019-07-16 09:51:14 +0900 | [diff] [blame] | 121 | |
| 122 | cc_test { |
| 123 | name: "linkerconfig_generator_unittest", |
| 124 | defaults: [ "linkerconfig_test_defaults" ], |
| 125 | srcs: [ |
| 126 | "generator/tests/*_test.cc", |
| 127 | ], |
| 128 | static_libs: [ |
| 129 | "linkerconfig_modules", |
| 130 | "linkerconfig_contents", |
| 131 | "linkerconfig_generator", |
| 132 | ], |
| 133 | data: [ |
| 134 | "generator/tests/data/*.txt", |
| 135 | ], |
Kiyoung Kim | 84cbf00 | 2019-08-21 19:46:51 +0900 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | cc_test { |
| 139 | name: "linkerconfig_contents_fulltest", |
| 140 | defaults: [ "linkerconfig_test_defaults" ], |
| 141 | local_include_dirs: [ |
| 142 | "contents/tests/configuration/include", |
| 143 | ], |
| 144 | srcs: [ |
| 145 | "contents/tests/configuration/*_test.cc", |
| 146 | ], |
| 147 | static_libs: [ |
| 148 | "linkerconfig_modules", |
| 149 | "linkerconfig_contents", |
| 150 | ], |
Jooyung Han | bfe0654 | 2019-11-14 13:27:19 +0900 | [diff] [blame] | 151 | host_supported: true, |
Martin Stjernholm | cb9df4f | 2019-10-02 20:47:12 +0100 | [diff] [blame] | 152 | } |