1cc_library_shared {
2    name: "libRSCpuRef",
3    defaults: ["libbcc-targets"],
4    vendor_available: true,
5    vndk: {
6        enabled: true,
7        support_system_process: true,
8    },
9
10    srcs: [
11        "rsCpuCore.cpp",
12        "rsCpuExecutable.cpp",
13        "rsCpuScript.cpp",
14        "rsCpuRuntimeMath.cpp",
15        "rsCpuScriptGroup.cpp",
16        "rsCpuScriptGroup2.cpp",
17        "rsCpuIntrinsic.cpp",
18        "rsCpuIntrinsic3DLUT.cpp",
19        "rsCpuIntrinsicBLAS.cpp",
20        "rsCpuIntrinsicBlend.cpp",
21        "rsCpuIntrinsicBlur.cpp",
22        "rsCpuIntrinsicColorMatrix.cpp",
23        "rsCpuIntrinsicConvolve3x3.cpp",
24        "rsCpuIntrinsicConvolve5x5.cpp",
25        "rsCpuIntrinsicHistogram.cpp",
26        "rsCpuIntrinsicResize.cpp",
27        "rsCpuIntrinsicLUT.cpp",
28        "rsCpuIntrinsicYuvToRGB.cpp",
29    ],
30
31    arch: {
32        arm64: {
33            cflags: [
34                "-DARCH_ARM_USE_INTRINSICS",
35                "-DARCH_ARM64_USE_INTRINSICS",
36                "-DARCH_ARM64_HAVE_NEON",
37            ],
38
39            srcs: [
40                "rsCpuIntrinsics_advsimd_3DLUT.S",
41                "rsCpuIntrinsics_advsimd_Convolve.S",
42                "rsCpuIntrinsics_advsimd_Blur.S",
43                "rsCpuIntrinsics_advsimd_ColorMatrix.S",
44                "rsCpuIntrinsics_advsimd_Resize.S",
45                "rsCpuIntrinsics_advsimd_YuvToRGB.S",
46                "rsCpuIntrinsics_advsimd_Blend.S",
47            ],
48        },
49
50        arm: {
51            cflags: [
52                "-DARCH_ARM_HAVE_VFP",
53                "-DARCH_ARM_USE_INTRINSICS",
54            ],
55
56            srcs: [
57                "rsCpuIntrinsics_neon_3DLUT.S",
58                "rsCpuIntrinsics_neon_Blend.S",
59                "rsCpuIntrinsics_neon_Blur.S",
60                "rsCpuIntrinsics_neon_Convolve.S",
61                "rsCpuIntrinsics_neon_ColorMatrix.S",
62                "rsCpuIntrinsics_neon_Resize.S",
63                "rsCpuIntrinsics_neon_YuvToRGB.S",
64            ],
65
66            asflags: ["-mfpu=neon"],
67
68            neon: {
69                cflags: [
70                    "-DARCH_ARM_HAVE_NEON",
71                ],
72            },
73        },
74
75        x86: {
76            ssse3: {
77                cflags: ["-DARCH_X86_HAVE_SSSE3"],
78                srcs: ["rsCpuIntrinsics_x86.cpp"],
79            },
80        },
81        x86_64: {
82            ssse3: {
83                cflags: ["-DARCH_X86_HAVE_SSSE3"],
84                srcs: ["rsCpuIntrinsics_x86.cpp"],
85            },
86        },
87    },
88
89    target: {
90        arm_on_x86: {
91            cflags: ["-DBUILD_ARM_FOR_X86"],
92        },
93    },
94
95    shared_libs: [
96        "libRS_internal",
97        "libc++",
98        "liblog",
99        "libz",
100
101        "libbcinfo",
102        "libblas",
103    ],
104    static_libs: ["libbnnmlowp"],
105    header_libs: [
106        "libutils_headers",
107        "libhardware_headers",
108    ],
109
110    include_dirs: [
111        "frameworks/compile/libbcc/include",
112        "frameworks/rs",
113    ],
114
115    cflags: [
116        "-Werror",
117        "-Wall",
118        "-Wextra",
119        "-Wno-unused-parameter",
120        "-Wno-unused-variable",
121    ],
122
123    product_variables: {
124        pdk: {
125            // Not building RenderScript modules in PDK builds, as libmediandk
126            // is not available in PDK.
127            enabled: false,
128        },
129    },
130}
131