| // Copyright (C) 2025 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| genrule { |
| name: "libfadec_decode_includes", |
| srcs: [ |
| "instrs.txt", |
| "parseinstrs.py", |
| ], |
| out: [ |
| // The ordering here (public first, then private) must be maintained! |
| "fadec-decode-public.inc", |
| "fadec-decode-private.inc", |
| ], |
| cmd: "python3 $(location parseinstrs.py) decode $(location instrs.txt) $(out) --32 --64 --stats", |
| } |
| |
| genrule { |
| name: "libfadec_encode_includes", |
| srcs: [ |
| "instrs.txt", |
| "parseinstrs.py", |
| ], |
| out: [ |
| // The ordering here (public first, then private) must be maintained! |
| "fadec-encode-public.inc", |
| "fadec-encode-private.inc", |
| ], |
| cmd: "python3 $(location parseinstrs.py) encode $(location instrs.txt) $(out) --32 --64 --stats", |
| } |
| |
| cc_library { |
| name: "libfadec", |
| srcs: [ |
| "decode.c", |
| "encode.c", |
| "format.c", |
| ], |
| generated_headers: [ |
| "libfadec_decode_includes", |
| "libfadec_encode_includes", |
| ], |
| export_generated_headers: [ |
| "libfadec_decode_includes", |
| "libfadec_encode_includes", |
| ], |
| export_include_dirs: ["."], |
| host_supported: true, |
| visibility: [ |
| "//external/lfi:__subpackages__", |
| ], |
| apex_available: [ |
| "com.android.media.swcodec", |
| ], |
| min_sdk_version: "31", |
| } |