1//
2// Copyright (C) 2011-2012 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
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    //   SPDX-license-identifier-NCSA
24    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
25}
26
27cc_library_shared {
28    name: "libbcinfo",
29    vendor_available: true,
30    vndk: {
31        enabled: true,
32        support_system_process: true,
33    },
34    host_supported: true,
35    defaults: [
36        "llvm-defaults",
37        "rs-version",
38    ],
39
40    srcs: [
41        "BitcodeTranslator.cpp",
42        "BitcodeWrapper.cpp",
43        "MetadataExtractor.cpp",
44    ],
45
46    cflags: [
47        "-Wall",
48        "-Wno-unused-parameter",
49        "-Werror",
50
51        "-D__DISABLE_ASSERTS",
52    ],
53
54    product_variables: {
55        eng: {
56            cflags: ["-U__DISABLE_ASSERTS"],
57        },
58    },
59
60    header_libs: ["libbcinfo-headers"],
61    export_header_lib_headers: ["libbcinfo-headers"],
62
63    include_dirs: [
64        "frameworks/rs",
65        "frameworks/compile/slang",
66        "frameworks/compile/libbcc/lib",
67    ],
68
69    static_libs: [
70        "libLLVMWrap",
71        "libLLVMBitReader_2_7",
72        "libLLVMBitReader_3_0",
73        "libLLVMBitWriter_3_2",
74	"libStripUnkAttr",
75    ],
76
77    target: {
78        windows: {
79            enabled: true,
80            shared_libs: ["libLLVM_android"],
81        },
82        darwin: {
83            shared_libs: ["libLLVM_android"],
84        },
85        linux_glibc: {
86            allow_undefined_symbols: true,
87        },
88        host: {
89            compile_multilib: "first",
90            static_libs: [
91                "libcutils",
92                "liblog",
93            ],
94        },
95        android: {
96            shared_libs: [
97                "liblog",
98            ],
99            static_libs: [
100                // Statically link-in the required LLVM libraries
101                "libLLVMBitReader",
102                "libLLVMCore",
103                "libLLVMSupport",
104            ],
105            // Export only the symbols in the bcinfo namespace.  In particular,
106            // do not, export symbols from the LLVM libraries.
107            version_script: "libbcinfo.map",
108        },
109    },
110}
111
112cc_library_headers {
113    name: "libbcinfo-headers",
114    vendor_available: true,
115    host_supported: true,
116    // TODO(b/153609531): remove when no longer needed.
117    native_bridge_supported: true,
118    export_include_dirs: ["include"],
119    target: {
120        windows: {
121            enabled: true,
122        },
123    },
124}
125
126subdirs = [
127    "BitReader_2_7",
128    "BitReader_3_0",
129    "tools",
130    "Wrap",
131]
132