blob: eaed1b9d43634b27673c42847d128be88e098bb9 [file] [log] [blame]
Ivan Lozano4fef93c2020-07-08 08:39:44 -04001// Copyright 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package rust
16
17import (
Ivan Lozano4fef93c2020-07-08 08:39:44 -040018 "strings"
19
Ivan Lozano45901ed2020-07-24 16:05:01 -040020 "github.com/google/blueprint"
Stephen Crane12e2cb72020-08-04 12:26:10 -070021 "github.com/google/blueprint/proptools"
Ivan Lozano45901ed2020-07-24 16:05:01 -040022
Ivan Lozano4fef93c2020-07-08 08:39:44 -040023 "android/soong/android"
Ivan Lozanobc9e4212020-09-25 16:08:34 -040024 "android/soong/cc"
Ivan Lozano3d947522020-09-23 13:26:25 -040025 cc_config "android/soong/cc/config"
Ivan Lozano4fef93c2020-07-08 08:39:44 -040026)
27
28var (
Ivan Lozanoec54eec2020-07-22 16:48:53 -040029 defaultBindgenFlags = []string{""}
Ivan Lozano4fef93c2020-07-08 08:39:44 -040030
31 // bindgen should specify its own Clang revision so updating Clang isn't potentially blocked on bindgen failures.
Aditya Kumaref7c1212024-02-02 17:22:03 +000032 bindgenClangVersion = "clang-r510928"
Ivan Lozano4fef93c2020-07-08 08:39:44 -040033
Peter Collingbourne9a868f12020-12-30 20:23:01 -080034 _ = pctx.VariableFunc("bindgenClangVersion", func(ctx android.PackageVarContext) string {
35 if override := ctx.Config().Getenv("LLVM_BINDGEN_PREBUILTS_VERSION"); override != "" {
36 return override
37 }
38 return bindgenClangVersion
39 })
40
Ivan Lozano4fef93c2020-07-08 08:39:44 -040041 //TODO(b/160803703) Use a prebuilt bindgen instead of the built bindgen.
Shao-Chuan Leeaa3231c2020-11-05 22:20:17 +090042 _ = pctx.HostBinToolVariable("bindgenCmd", "bindgen")
Colin Cross567d3422022-04-28 15:30:09 -070043 _ = pctx.VariableFunc("bindgenHostPrebuiltTag", func(ctx android.PackageVarContext) string {
44 if ctx.Config().UseHostMusl() {
45 // This is a hack to use the glibc bindgen binary until we have a musl version checked in.
46 return "linux-x86"
47 } else {
48 return "${config.HostPrebuiltTag}"
49 }
50 })
51 _ = pctx.VariableFunc("bindgenClangLibdir", func(ctx android.PackageVarContext) string {
52 if ctx.Config().UseHostMusl() {
Colin Cross645874d2022-10-14 14:18:21 -070053 return "musl/lib/"
Colin Cross567d3422022-04-28 15:30:09 -070054 } else {
Yi Kongbd188812023-02-08 19:51:59 +090055 return "lib/"
Colin Cross567d3422022-04-28 15:30:09 -070056 }
57 })
Ivan Lozano4fef93c2020-07-08 08:39:44 -040058 _ = pctx.SourcePathVariable("bindgenClang",
Colin Cross567d3422022-04-28 15:30:09 -070059 "${cc_config.ClangBase}/${bindgenHostPrebuiltTag}/${bindgenClangVersion}/bin/clang")
Ivan Lozano4fef93c2020-07-08 08:39:44 -040060 _ = pctx.SourcePathVariable("bindgenLibClang",
Colin Cross567d3422022-04-28 15:30:09 -070061 "${cc_config.ClangBase}/${bindgenHostPrebuiltTag}/${bindgenClangVersion}/${bindgenClangLibdir}")
Ivan Lozano4fef93c2020-07-08 08:39:44 -040062
63 //TODO(ivanlozano) Switch this to RuleBuilder
Andrei Homescu78a1f8d2023-07-08 00:35:15 +000064 //
65 //TODO Pass the flag files directly to bindgen e.g. with @file when it supports that.
66 //See https://github.com/rust-lang/rust-bindgen/issues/2508.
Ivan Lozano4fef93c2020-07-08 08:39:44 -040067 bindgen = pctx.AndroidStaticRule("bindgen",
68 blueprint.RuleParams{
Ivan Lozanoec54eec2020-07-22 16:48:53 -040069 Command: "CLANG_PATH=$bindgenClang LIBCLANG_PATH=$bindgenLibClang RUSTFMT=${config.RustBin}/rustfmt " +
Andrei Homescu78a1f8d2023-07-08 00:35:15 +000070 "$cmd $flags $$(cat $flagfiles) $in -o $out -- -MD -MF $out.d $cflags",
Ivan Lozanoc564d2d2020-08-04 15:43:37 -040071 CommandDeps: []string{"$cmd"},
Ivan Lozanoe1e844b2020-07-24 15:16:30 -040072 Deps: blueprint.DepsGCC,
73 Depfile: "$out.d",
Ivan Lozano4fef93c2020-07-08 08:39:44 -040074 },
Andrei Homescu78a1f8d2023-07-08 00:35:15 +000075 "cmd", "flags", "flagfiles", "cflags")
Ivan Lozano4fef93c2020-07-08 08:39:44 -040076)
77
78func init() {
79 android.RegisterModuleType("rust_bindgen", RustBindgenFactory)
Ivan Lozanof6fe9952020-07-22 16:30:20 -040080 android.RegisterModuleType("rust_bindgen_host", RustBindgenHostFactory)
Ivan Lozano4fef93c2020-07-08 08:39:44 -040081}
82
83var _ SourceProvider = (*bindgenDecorator)(nil)
84
85type BindgenProperties struct {
Ivan Lozano3d947522020-09-23 13:26:25 -040086 // The wrapper header file. By default this is assumed to be a C header unless the extension is ".hh" or ".hpp".
87 // This is used to specify how to interpret the header and determines which '-std' flag to use by default.
88 //
89 // If your C++ header must have some other extension, then the default behavior can be overridden by setting the
90 // cpp_std property.
Ivan Lozano4fef93c2020-07-08 08:39:44 -040091 Wrapper_src *string `android:"path,arch_variant"`
92
93 // list of bindgen-specific flags and options
Ivan Lozano26ecd6c2020-07-31 13:40:31 -040094 Bindgen_flags []string `android:"arch_variant"`
Ivan Lozano4fef93c2020-07-08 08:39:44 -040095
Andrei Homescu78a1f8d2023-07-08 00:35:15 +000096 // list of files containing extra bindgen flags
97 Bindgen_flag_files []string `android:"arch_variant"`
98
Ivan Lozanoc564d2d2020-08-04 15:43:37 -040099 // module name of a custom binary/script which should be used instead of the 'bindgen' binary. This custom
100 // binary must expect arguments in a similar fashion to bindgen, e.g.
101 //
102 // "my_bindgen [flags] wrapper_header.h -o [output_path] -- [clang flags]"
Liz Kammereda93982021-04-20 10:15:41 -0400103 Custom_bindgen string
Ellen Arteca810c37e2024-04-23 00:17:47 +0000104
105 // flag to indicate if bindgen should handle `static inline` functions (default is false)
106 Handle_static_inline bool
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400107}
108
109type bindgenDecorator struct {
Andrei Homescuc7767922020-08-05 06:36:19 -0700110 *BaseSourceProvider
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400111
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400112 Properties BindgenProperties
113 ClangProperties cc.RustBindgenClangProperties
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400114}
115
Ivan Lozano3d947522020-09-23 13:26:25 -0400116func (b *bindgenDecorator) getStdVersion(ctx ModuleContext, src android.Path) (string, bool) {
117 // Assume headers are C headers
118 isCpp := false
119 stdVersion := ""
120
121 switch src.Ext() {
122 case ".hpp", ".hh":
123 isCpp = true
124 }
125
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400126 if String(b.ClangProperties.Cpp_std) != "" && String(b.ClangProperties.C_std) != "" {
Ivan Lozano3d947522020-09-23 13:26:25 -0400127 ctx.PropertyErrorf("c_std", "c_std and cpp_std cannot both be defined at the same time.")
128 }
129
Ivan Lozano829e1e92023-10-09 11:30:09 -0400130 if b.ClangProperties.Cpp_std != nil {
131 isCpp = true
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400132 if String(b.ClangProperties.Cpp_std) == "experimental" {
Ivan Lozano3d947522020-09-23 13:26:25 -0400133 stdVersion = cc_config.ExperimentalCppStdVersion
Ivan Lozano829e1e92023-10-09 11:30:09 -0400134 } else if String(b.ClangProperties.Cpp_std) == "default" || String(b.ClangProperties.Cpp_std) == "" {
Ivan Lozano3d947522020-09-23 13:26:25 -0400135 stdVersion = cc_config.CppStdVersion
136 } else {
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400137 stdVersion = String(b.ClangProperties.Cpp_std)
Ivan Lozano3d947522020-09-23 13:26:25 -0400138 }
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400139 } else if b.ClangProperties.C_std != nil {
Ivan Lozano829e1e92023-10-09 11:30:09 -0400140 isCpp = false
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400141 if String(b.ClangProperties.C_std) == "experimental" {
Ivan Lozano3d947522020-09-23 13:26:25 -0400142 stdVersion = cc_config.ExperimentalCStdVersion
Ivan Lozano829e1e92023-10-09 11:30:09 -0400143 } else if String(b.ClangProperties.C_std) == "default" || String(b.ClangProperties.C_std) == "" {
Ivan Lozano3d947522020-09-23 13:26:25 -0400144 stdVersion = cc_config.CStdVersion
145 } else {
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400146 stdVersion = String(b.ClangProperties.C_std)
Ivan Lozano3d947522020-09-23 13:26:25 -0400147 }
148 } else if isCpp {
149 stdVersion = cc_config.CppStdVersion
150 } else {
151 stdVersion = cc_config.CStdVersion
152 }
153
154 return stdVersion, isCpp
155}
156
Thiébaud Weksteen31f1bb82020-08-27 13:37:29 +0200157func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) android.Path {
158 ccToolchain := ctx.RustModule().ccToolchain(ctx)
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400159
160 var cflags []string
Ivan Lozano45901ed2020-07-24 16:05:01 -0400161 var implicits android.Paths
162
Ivan Lozanoddd0bdb2020-08-28 17:00:26 -0400163 implicits = append(implicits, deps.depGeneratedHeaders...)
Ivan Lozano45901ed2020-07-24 16:05:01 -0400164
165 // Default clang flags
Colin Cross0523ba22021-07-14 18:45:05 -0700166 cflags = append(cflags, "${cc_config.CommonGlobalCflags}")
Ivan Lozano45901ed2020-07-24 16:05:01 -0400167 if ctx.Device() {
Colin Cross0523ba22021-07-14 18:45:05 -0700168 cflags = append(cflags, "${cc_config.DeviceGlobalCflags}")
Ivan Lozano45901ed2020-07-24 16:05:01 -0400169 }
170
171 // Toolchain clang flags
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400172 cflags = append(cflags, "-target "+ccToolchain.ClangTriple())
Colin Cross33bac242021-07-14 17:03:16 -0700173 cflags = append(cflags, strings.ReplaceAll(ccToolchain.Cflags(), "${config.", "${cc_config."))
174 cflags = append(cflags, strings.ReplaceAll(ccToolchain.ToolchainCflags(), "${config.", "${cc_config."))
Ivan Lozano45901ed2020-07-24 16:05:01 -0400175
Kiyoung Kimaa394802024-01-08 12:55:45 +0900176 if ctx.RustModule().InVendorOrProduct() {
Ivan Lozanoe950cda2021-11-09 11:26:04 -0500177 cflags = append(cflags, "-D__ANDROID_VNDK__")
178 if ctx.RustModule().InVendor() {
179 cflags = append(cflags, "-D__ANDROID_VENDOR__")
Justin Yun41cbb5e2023-11-29 17:58:16 +0900180
181 vendorApiLevel := ctx.Config().VendorApiLevel()
182 if vendorApiLevel == "" {
183 // TODO(b/314036847): This is a fallback for UDC targets.
184 // This must be a build failure when UDC is no longer built
185 // from this source tree.
186 vendorApiLevel = ctx.Config().PlatformSdkVersion().String()
187 }
188 cflags = append(cflags, "-D__ANDROID_VENDOR_API__="+vendorApiLevel)
Ivan Lozanoe950cda2021-11-09 11:26:04 -0500189 } else if ctx.RustModule().InProduct() {
190 cflags = append(cflags, "-D__ANDROID_PRODUCT__")
191 }
192 }
193
194 if ctx.RustModule().InRecovery() {
195 cflags = append(cflags, "-D__ANDROID_RECOVERY__")
196 }
197
198 if mctx, ok := ctx.(*moduleContext); ok && mctx.apexVariationName() != "" {
199 cflags = append(cflags, "-D__ANDROID_APEX__")
Ivan Lozanoe950cda2021-11-09 11:26:04 -0500200 }
201
202 if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
203 cflags = append(cflags, "-D__ANDROID_NATIVE_BRIDGE__")
204 }
205
Ivan Lozano45901ed2020-07-24 16:05:01 -0400206 // Dependency clang flags and include paths
207 cflags = append(cflags, deps.depClangFlags...)
208 for _, include := range deps.depIncludePaths {
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400209 cflags = append(cflags, "-I"+include.String())
210 }
Ivan Lozano45901ed2020-07-24 16:05:01 -0400211 for _, include := range deps.depSystemIncludePaths {
212 cflags = append(cflags, "-isystem "+include.String())
213 }
214
Stephen Crane12e2cb72020-08-04 12:26:10 -0700215 esc := proptools.NinjaAndShellEscapeList
216
Ivan Lozano0a2a1152020-10-16 10:49:08 -0400217 // Filter out invalid cflags
218 for _, flag := range b.ClangProperties.Cflags {
219 if flag == "-x c++" || flag == "-xc++" {
220 ctx.PropertyErrorf("cflags",
221 "-x c++ should not be specified in cflags; setting cpp_std specifies this is a C++ header, or change the file extension to '.hpp' or '.hh'")
222 }
223 if strings.HasPrefix(flag, "-std=") {
224 ctx.PropertyErrorf("cflags",
225 "-std should not be specified in cflags; instead use c_std or cpp_std")
226 }
227 }
228
Ivan Lozano45901ed2020-07-24 16:05:01 -0400229 // Module defined clang flags and include paths
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400230 cflags = append(cflags, esc(b.ClangProperties.Cflags)...)
231 for _, include := range b.ClangProperties.Local_include_dirs {
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400232 cflags = append(cflags, "-I"+android.PathForModuleSrc(ctx, include).String())
Ivan Lozano45901ed2020-07-24 16:05:01 -0400233 implicits = append(implicits, android.PathForModuleSrc(ctx, include))
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400234 }
235
236 bindgenFlags := defaultBindgenFlags
Stephen Crane12e2cb72020-08-04 12:26:10 -0700237 bindgenFlags = append(bindgenFlags, esc(b.Properties.Bindgen_flags)...)
Ellen Arteca810c37e2024-04-23 00:17:47 +0000238 if b.Properties.Handle_static_inline {
239 bindgenFlags = append(bindgenFlags, "--experimental --wrap-static-fns")
240 }
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400241
Andrei Homescu78a1f8d2023-07-08 00:35:15 +0000242 // cat reads from stdin if its command line is empty,
243 // so we pass in /dev/null if there are no other flag files
244 bindgenFlagFiles := []string{"/dev/null"}
245 for _, flagFile := range b.Properties.Bindgen_flag_files {
246 bindgenFlagFiles = append(bindgenFlagFiles, android.PathForModuleSrc(ctx, flagFile).String())
247 implicits = append(implicits, android.PathForModuleSrc(ctx, flagFile))
248 }
249
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400250 wrapperFile := android.OptionalPathForModuleSrc(ctx, b.Properties.Wrapper_src)
251 if !wrapperFile.Valid() {
252 ctx.PropertyErrorf("wrapper_src", "invalid path to wrapper source")
253 }
254
Ivan Lozano3d947522020-09-23 13:26:25 -0400255 // Add C std version flag
256 stdVersion, isCpp := b.getStdVersion(ctx, wrapperFile.Path())
257 cflags = append(cflags, "-std="+stdVersion)
258
259 // Specify the header source language to avoid ambiguity.
260 if isCpp {
261 cflags = append(cflags, "-x c++")
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400262 // Add any C++ only flags.
263 cflags = append(cflags, esc(b.ClangProperties.Cppflags)...)
Ivan Lozano3d947522020-09-23 13:26:25 -0400264 } else {
265 cflags = append(cflags, "-x c")
266 }
267
Colin Cross8a5a1e22022-10-14 15:53:02 -0700268 // clang-r468909b complains about the -x c in the flags in clang-sys parse_search_paths:
269 // clang: error: '-x c' after last input file has no effect [-Werror,-Wunused-command-line-argument]
270 cflags = append(cflags, "-Wno-unused-command-line-argument")
271
Yi Kong52e5e6b2024-02-25 12:45:30 +0800272 // The Clang version used by CXX can be newer than the one used by Bindgen, and uses warning related flags that
273 // it cannot recognize. Turn off unknown warning flags warning.
274 cflags = append(cflags, "-Wno-unknown-warning-option")
Yi Kong4f664e92022-07-14 20:36:15 +0800275
Andrei Homescuc7767922020-08-05 06:36:19 -0700276 outputFile := android.PathForModuleOut(ctx, b.BaseSourceProvider.getStem(ctx)+".rs")
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400277
Ivan Lozanoc564d2d2020-08-04 15:43:37 -0400278 var cmd, cmdDesc string
279 if b.Properties.Custom_bindgen != "" {
Andrei Homescu44946852023-07-07 04:59:07 +0000280 cmd = ctx.GetDirectDepWithTag(b.Properties.Custom_bindgen, customBindgenDepTag).(android.HostToolProvider).HostToolPath().String()
Ivan Lozanoc564d2d2020-08-04 15:43:37 -0400281 cmdDesc = b.Properties.Custom_bindgen
282 } else {
283 cmd = "$bindgenCmd"
284 cmdDesc = "bindgen"
285 }
286
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400287 ctx.Build(pctx, android.BuildParams{
288 Rule: bindgen,
Ivan Lozanoc564d2d2020-08-04 15:43:37 -0400289 Description: strings.Join([]string{cmdDesc, wrapperFile.Path().Rel()}, " "),
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400290 Output: outputFile,
291 Input: wrapperFile.Path(),
Ivan Lozano45901ed2020-07-24 16:05:01 -0400292 Implicits: implicits,
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400293 Args: map[string]string{
Andrei Homescu78a1f8d2023-07-08 00:35:15 +0000294 "cmd": cmd,
295 "flags": strings.Join(bindgenFlags, " "),
296 "flagfiles": strings.Join(bindgenFlagFiles, " "),
297 "cflags": strings.Join(cflags, " "),
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400298 },
299 })
Ivan Lozanoc564d2d2020-08-04 15:43:37 -0400300
Chih-Hung Hsiehc49649c2020-10-01 21:25:05 -0700301 b.BaseSourceProvider.OutputFiles = android.Paths{outputFile}
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400302 return outputFile
303}
304
Andrei Homescuc7767922020-08-05 06:36:19 -0700305func (b *bindgenDecorator) SourceProviderProps() []interface{} {
306 return append(b.BaseSourceProvider.SourceProviderProps(),
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400307 &b.Properties, &b.ClangProperties)
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400308}
309
Ivan Lozano10735d92020-07-22 09:14:47 -0400310// rust_bindgen generates Rust FFI bindings to C libraries using bindgen given a wrapper header as the primary input.
311// Bindgen has a number of flags to control the generated source, and additional flags can be passed to clang to ensure
Thiébaud Weksteen295c72b2020-09-23 18:10:17 +0200312// the header and generated source is appropriately handled. It is recommended to add it as a dependency in the
Vinh Tran4eeb2a92023-08-14 13:29:30 -0400313// rlibs or rustlibs property. It may also be added in the srcs property for external crates, using the ":"
Thiébaud Weksteen295c72b2020-09-23 18:10:17 +0200314// prefix.
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400315func RustBindgenFactory() android.Module {
316 module, _ := NewRustBindgen(android.HostAndDeviceSupported)
317 return module.Init()
318}
319
Ivan Lozanof6fe9952020-07-22 16:30:20 -0400320func RustBindgenHostFactory() android.Module {
321 module, _ := NewRustBindgen(android.HostSupported)
322 return module.Init()
323}
324
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400325func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorator) {
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400326 bindgen := &bindgenDecorator{
Andrei Homescuc7767922020-08-05 06:36:19 -0700327 BaseSourceProvider: NewSourceProvider(),
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400328 Properties: BindgenProperties{},
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400329 ClangProperties: cc.RustBindgenClangProperties{},
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400330 }
Ivan Lozano26ecd6c2020-07-31 13:40:31 -0400331
Matthew Maurere94f3e72022-08-10 20:25:50 +0000332 module := NewSourceProviderModule(hod, bindgen, false, true)
333
334 android.AddLoadHook(module, func(ctx android.LoadHookContext) {
335 type stub_props struct {
336 Visibility []string
337 }
338 props := &stub_props{[]string{":__subpackages__"}}
339 ctx.PrependProperties(props)
340 })
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400341
342 return module, bindgen
343}
344
Andrei Homescuc7767922020-08-05 06:36:19 -0700345func (b *bindgenDecorator) SourceProviderDeps(ctx DepsContext, deps Deps) Deps {
346 deps = b.BaseSourceProvider.SourceProviderDeps(ctx, deps)
Dan Albert30e66dc2023-02-23 19:17:50 +0000347 if ctx.toolchain().Bionic() && !ctx.RustModule().compiler.noStdlibs() {
Thiébaud Weksteenf1ff54a2021-03-22 14:24:54 +0100348 deps = bionicDeps(ctx, deps, false)
Colin Crosse32f0932022-01-23 20:48:36 -0800349 } else if ctx.Os() == android.LinuxMusl {
350 deps = muslDeps(ctx, deps, false)
Ivan Lozano45901ed2020-07-24 16:05:01 -0400351 }
352
Ivan Lozanobc9e4212020-09-25 16:08:34 -0400353 deps.SharedLibs = append(deps.SharedLibs, b.ClangProperties.Shared_libs...)
354 deps.StaticLibs = append(deps.StaticLibs, b.ClangProperties.Static_libs...)
Ivan Lozano1dbfa142024-03-29 14:48:11 +0000355 deps.HeaderLibs = append(deps.HeaderLibs, b.ClangProperties.Header_libs...)
Ivan Lozano4fef93c2020-07-08 08:39:44 -0400356 return deps
357}