xref: /aosp_15_r20/external/swiftshader/third_party/llvm-16.0/scripts/template_Android.bp (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1%$%generated_file_comment
2
3package {
4    // http://go/android-license-faq
5    // A large-scale-change added 'default_applicable_licenses' to import
6    // the below license kinds from "external_swiftshader_license":
7    //   SPDX-license-identifier-Apache-2.0
8    //   SPDX-license-identifier-BSD
9    //   SPDX-license-identifier-MIT
10    //   SPDX-license-identifier-NCSA
11    //   legacy_unencumbered
12    default_applicable_licenses: ["external_swiftshader_license"],
13}
14
15cc_defaults {
16    name: "libLLVM16_swiftshader_defaults",
17
18    device_supported: true,
19    host_supported: true,
20    vendor: true,
21
22    srcs: [
23%$%files_llvm
24    ],
25
26    arch: {
27        arm: {
28            srcs: [
29%$%files_ARM
30            ],
31        },
32        arm64: {
33            srcs: [
34%$%files_AArch64
35            ],
36        },
37        riscv64: {
38            srcs: [
39%$%files_RISCV
40            ],
41        },
42        x86: {
43            srcs: [
44%$%files_x86
45            ],
46        },
47        x86_64: {
48            srcs: [
49%$%files_x86
50            ],
51        },
52    },
53
54    local_include_dirs: [
55        ".",
56        "llvm/lib/Target/X86",
57        "llvm/lib/Target/AArch64",
58        "llvm/lib/Target/ARM",
59        "llvm/lib/Target/RISCV",
60        "configs/common/lib/Target/AArch64",
61        "configs/common/lib/Target/ARM",
62        "configs/common/lib/Target/X86",
63        "configs/common/lib/Target/RISCV",
64        "configs/common/lib/ExecutionEngine/JITLink",
65    ],
66
67    export_include_dirs: [
68        "llvm/include",
69        "configs/common/include",
70        "configs/android/include",
71    ],
72
73    cflags: [
74        "-Wno-implicit-fallthrough",
75        "-Wno-unreachable-code-loop-increment",
76        "-Wno-unused-parameter",
77        "-Wno-unused-variable",
78        "-DBLAKE3_NO_AVX512",
79        "-DBLAKE3_NO_AVX2",
80        "-DBLAKE3_NO_SSE41",
81        "-DBLAKE3_NO_SSE2",
82        "-DBLAKE3_USE_NEON=0",
83        // Avoid collision with LLVM's "llvm::jitlink::i386" namespace.
84        "-Ui386",
85    ],
86
87    sanitize: {
88        // HWASan slows down LLVM JIT compilation more than usual.
89        // b/193198227
90        hwaddress: false,
91    },
92}
93
94cc_library_static {
95    name: "libLLVM16_swiftshader",
96
97    defaults: [ "libLLVM16_swiftshader_defaults" ],
98}
99
100cc_library_static {
101    name: "libLLVM16_swiftshader_debug",
102
103    defaults: [ "libLLVM16_swiftshader_defaults" ],
104
105    cflags: [
106        "-UNDEBUG",
107    ],
108
109    srcs: [
110%$%files_llvm_debug
111    ],
112}
113