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
17cc_library_shared {
18    name: "libbcinfo",
19    host_supported: true,
20    defaults: [
21        "llvm-defaults",
22        "rs-version",
23    ],
24
25    srcs: [
26        "BitcodeTranslator.cpp",
27        "BitcodeWrapper.cpp",
28        "MetadataExtractor.cpp",
29    ],
30
31    cflags: [
32        "-Wall",
33        "-Wno-unused-parameter",
34        "-Werror",
35
36        "-D__DISABLE_ASSERTS",
37    ],
38
39    product_variables: {
40        eng: {
41            cflags: ["-U__DISABLE_ASSERTS"],
42        },
43    },
44
45    header_libs: ["libbcinfo-headers"],
46    export_header_lib_headers: ["libbcinfo-headers"],
47
48    include_dirs: [
49        "frameworks/rs",
50        "frameworks/compile/slang",
51        "frameworks/compile/libbcc/lib",
52    ],
53
54    static_libs: [
55        "libLLVMWrap",
56        "libLLVMBitReader_2_7",
57        "libLLVMBitReader_3_0",
58        "libLLVMBitWriter_3_2",
59	"libStripUnkAttr",
60    ],
61
62    target: {
63        windows: {
64            enabled: true,
65            shared_libs: ["libLLVM"],
66        },
67        darwin: {
68            host_ldlibs: [
69                "-ldl",
70                "-lpthread",
71            ],
72            shared_libs: ["libLLVM"],
73        },
74        linux: {
75            host_ldlibs: [
76                "-ldl",
77                "-lpthread",
78            ],
79            allow_undefined_symbols: true,
80        },
81        host: {
82            compile_multilib: "first",
83            static_libs: [
84                "libcutils",
85                "liblog",
86            ],
87            product_variables: {
88                unbundled_build: {
89                    // don't build for unbundled branches
90                    enabled: false,
91                },
92            },
93        },
94        android: {
95            shared_libs: [
96                "liblog",
97            ],
98            static_libs: [
99                // Statically link-in the required LLVM libraries
100                "libLLVMBitReader",
101                "libLLVMCore",
102                "libLLVMSupport",
103            ],
104            // Export only the symbols in the bcinfo namespace.  In particular,
105            // do not, export symbols from the LLVM libraries.
106            version_script: "libbcinfo.map",
107        },
108    },
109}
110
111cc_library_headers {
112    name: "libbcinfo-headers",
113    host_supported: true,
114    export_include_dirs: ["include"],
115    target: {
116        windows: {
117            enabled: true,
118        },
119    },
120}
121
122subdirs = [
123    "BitReader_2_7",
124    "BitReader_3_0",
125    "tools",
126    "Wrap",
127]
128