xref: /aosp_15_r20/external/sonivox/arm-wt-22k/Android.bp (revision f81fb7c475c4b71ff83bdcc517de2a8c174e4e5c)
1package {
2    default_applicable_licenses: ["external_sonivox_arm-wt-22k_license"],
3}
4
5// Added automatically by a large-scale-change
6// See: http://go/android-license-faq
7license {
8    name: "external_sonivox_arm-wt-22k_license",
9    visibility: [":__subpackages__"],
10    license_kinds: [
11        "SPDX-license-identifier-Apache-2.0",
12    ],
13    license_text: [
14        "NOTICE",
15    ],
16}
17
18cc_defaults {
19    name: "libsonivox-defaults",
20    srcs: [
21        "lib_src/eas_data.c",
22        "lib_src/eas_dlssynth.c",
23        "lib_src/eas_flog.c",
24        "lib_src/eas_imelody.c",
25        "lib_src/eas_imelodydata.c",
26        "lib_src/eas_math.c",
27        "lib_src/eas_mdls.c",
28        "lib_src/eas_midi.c",
29        "lib_src/eas_mididata.c",
30        "lib_src/eas_mixbuf.c",
31        "lib_src/eas_mixer.c",
32        "lib_src/eas_ota.c",
33        "lib_src/eas_otadata.c",
34        "lib_src/eas_pan.c",
35        "lib_src/eas_pcm.c",
36        "lib_src/eas_pcmdata.c",
37        "lib_src/eas_public.c",
38        "lib_src/eas_reverb.c",
39        "lib_src/eas_reverbdata.c",
40        "lib_src/eas_rtttl.c",
41        "lib_src/eas_rtttldata.c",
42        "lib_src/eas_smf.c",
43        "lib_src/eas_smfdata.c",
44        "lib_src/eas_voicemgt.c",
45        "lib_src/eas_wtengine.c",
46        "lib_src/eas_wtsynth.c",
47        "lib_src/eas_xmf.c",
48        "lib_src/eas_xmfdata.c",
49        "lib_src/wt_22khz.c",
50        "host_src/eas_config.c",
51        "host_src/eas_hostmm.c",
52        "host_src/eas_report.c",
53    ],
54
55    cflags: [
56        "-O2",
57        "-DUNIFIED_DEBUG_MESSAGES",
58        "-DEAS_WT_SYNTH",
59        "-D_IMELODY_PARSER",
60        "-D_RTTTL_PARSER",
61        "-D_OTA_PARSER",
62        "-D_XMF_PARSER",
63        "-DNUM_OUTPUT_CHANNELS=2",
64        "-D_SAMPLE_RATE_22050",
65        "-DMAX_SYNTH_VOICES=64",
66        "-D_16_BIT_SAMPLES",
67        "-D_FILTER_ENABLED",
68        "-DDLS_SYNTHESIZER",
69        "-D_REVERB_ENABLED",
70
71        "-Wno-unused-parameter",
72        "-Werror",
73
74        // not using these options
75        // "-D_WAVE_PARSER",
76        // "-D_IMA_DECODER", // (needed for IMA-ADPCM wave files)
77        // "-D_CHORUS_ENABLED",
78    ],
79
80    local_include_dirs: [
81        "host_src",
82        "lib_src",
83    ],
84    export_include_dirs: ["include"],
85
86    shared_libs: [
87        "liblog",
88    ],
89
90    host_supported: true,
91
92    target: {
93        darwin: {
94            enabled: false,
95        },
96    },
97
98    arch: {
99        arm: {
100            instruction_set: "arm",
101
102            srcs: [
103                "lib_src/ARM-E_filter_gnu.s",
104                //"lib_src/ARM-E_interpolate_loop_gnu.s",
105                //"lib_src/ARM-E_interpolate_noloop_gnu.s",
106                "lib_src/ARM-E_mastergain_gnu.s",
107                //"lib_src/ARM-E_voice_gain_gnu.s",
108            ],
109
110            asflags: [
111                // In order to use #include instead of .include
112                "-xassembler-with-cpp",
113
114                "-DSAMPLE_RATE_22050=1",
115                "-DSTEREO_OUTPUT=1",
116                "-DFILTER_ENABLED=1",
117                "-DSAMPLES_16_BIT=1",
118            ],
119
120            cflags: [
121                "-DNATIVE_EAS_KERNEL",
122            ],
123        },
124    },
125    sanitize: {
126        cfi: true,
127        misc_undefined: [
128            "bounds",
129            "unsigned-integer-overflow",
130            "signed-integer-overflow",
131        ],
132    }
133}
134
135cc_library {
136    name: "libsonivoxwithoutjet",
137    defaults: ["libsonivox-defaults"],
138    apex_available: [
139        "//apex_available:platform",
140        "com.android.media",
141    ],
142    min_sdk_version: "29",
143}
144
145cc_library {
146    name: "libsonivox",
147    defaults: ["libsonivox-defaults"],
148    srcs: [
149        "lib_src/jet.c",
150    ],
151
152    cflags: [
153        "-DJET_INTERFACE",
154    ],
155}
156