• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
2//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
3//     DEPENDING ON IT IN YOUR PROJECT. ***
4package {
5    default_applicable_licenses: ["external_dng_sdk_license"],
6}
7
8// Added automatically by a large-scale-change that took the approach of
9// 'apply every license found to every target'. While this makes sure we respect
10// every license restriction, it may not be entirely correct.
11//
12// e.g. GPL in an MIT project might only apply to the contrib/ directory.
13//
14// Please consider splitting the single license below into multiple licenses,
15// taking care not to lose any license_kind information, and overriding the
16// default license using the 'licenses: [...]' property on targets as needed.
17//
18// For unused files, consider creating a 'fileGroup' with "//visibility:private"
19// to attach the license to, and including a comment whether the files may be
20// used in the current project.
21//
22// large-scale-change included anything that looked like it might be a license
23// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
24//
25// Please consider removing redundant or irrelevant files from 'license_text:'.
26// See: http://go/android-license-faq
27license {
28    name: "external_dng_sdk_license",
29    visibility: [":__subpackages__"],
30    license_kinds: [
31        "SPDX-license-identifier-Apache-2.0",
32        "SPDX-license-identifier-MIT",
33        "legacy_by_exception_only", // by exception only
34    ],
35    license_text: [
36        "LICENSE",
37        "LICENSE.source_code",
38        "LICENSE.technology",
39        "NOTICE",
40        "PATENTS",
41    ],
42}
43
44cc_defaults {
45    name: "libdng_sdk-defaults",
46    srcs: [
47        "source/dng_1d_function.cpp",
48        "source/dng_1d_table.cpp",
49        "source/dng_abort_sniffer.cpp",
50        "source/dng_area_task.cpp",
51        "source/dng_bad_pixels.cpp",
52        "source/dng_bottlenecks.cpp",
53        "source/dng_camera_profile.cpp",
54        "source/dng_color_space.cpp",
55        "source/dng_color_spec.cpp",
56        "source/dng_date_time.cpp",
57        "source/dng_exceptions.cpp",
58        "source/dng_exif.cpp",
59        "source/dng_file_stream.cpp",
60        "source/dng_filter_task.cpp",
61        "source/dng_fingerprint.cpp",
62        "source/dng_gain_map.cpp",
63        "source/dng_globals.cpp",
64        "source/dng_host.cpp",
65        "source/dng_hue_sat_map.cpp",
66        "source/dng_ifd.cpp",
67        "source/dng_image.cpp",
68        "source/dng_image_writer.cpp",
69        "source/dng_info.cpp",
70        "source/dng_iptc.cpp",
71        "source/dng_jpeg_image.cpp",
72        "source/dng_jpeg_memory_source.cpp",
73        "source/dng_lens_correction.cpp",
74        "source/dng_linearization_info.cpp",
75        "source/dng_lossless_jpeg.cpp",
76        "source/dng_matrix.cpp",
77        "source/dng_memory.cpp",
78        "source/dng_memory_stream.cpp",
79        "source/dng_misc_opcodes.cpp",
80        "source/dng_mosaic_info.cpp",
81        "source/dng_mutex.cpp",
82        "source/dng_negative.cpp",
83        "source/dng_opcode_list.cpp",
84        "source/dng_opcodes.cpp",
85        "source/dng_orientation.cpp",
86        "source/dng_parse_utils.cpp",
87        "source/dng_pixel_buffer.cpp",
88        "source/dng_point.cpp",
89        "source/dng_preview.cpp",
90        "source/dng_pthread.cpp",
91        "source/dng_rational.cpp",
92        "source/dng_read_image.cpp",
93        "source/dng_rect.cpp",
94        "source/dng_ref_counted_block.cpp",
95        "source/dng_reference.cpp",
96        "source/dng_render.cpp",
97        "source/dng_resample.cpp",
98        "source/dng_safe_arithmetic.cpp",
99        "source/dng_shared.cpp",
100        "source/dng_simple_image.cpp",
101        "source/dng_spline.cpp",
102        "source/dng_stream.cpp",
103        "source/dng_string.cpp",
104        "source/dng_string_list.cpp",
105        "source/dng_tag_types.cpp",
106        "source/dng_temperature.cpp",
107        "source/dng_tile_iterator.cpp",
108        "source/dng_tone_curve.cpp",
109        "source/dng_utils.cpp",
110        "source/dng_xy_coord.cpp",
111        "source/dng_xmp.cpp",
112    ],
113    cflags: [
114        "-DUNIX_ENV=1",
115        "-DqDNGBigEndian=0",
116        "-DqDNGThreadSafe=1",
117        "-DqDNGUseLibJPEG=1",
118        "-DqDNGUseXMP=0",
119        "-DqDNGValidateTarget=1",
120        "-DqAndroid=1",
121        "-Werror",
122        "-Wsign-compare",
123        "-Wno-reorder",
124        "-Wframe-larger-than=20000",
125
126        // Ignore unused parameters.
127        "-Wno-unused-parameter",
128
129        // Some integral return types are annotated with "const."
130        "-Wno-ignored-qualifiers",
131    ],
132
133    rtti: true,
134    cppflags: ["-fexceptions"],
135
136    sanitize: {
137        misc_undefined: [
138            "unsigned-integer-overflow",
139            "signed-integer-overflow",
140        ],
141    },
142}
143
144cc_library {
145    name: "libdng_sdk",
146    host_supported: true,
147    vendor_available: true,
148    defaults: ["libdng_sdk-defaults"],
149
150    cflags: ["-DqDNGValidate=0"],
151
152    shared_libs: [
153        "libz",
154        "libjpeg",
155    ],
156
157    target: {
158        host_linux: {
159            static_libs: ["libcompiler_rt-extras"],
160        },
161        darwin: {
162            host_ldlibs: [
163                "-framework AppKit",
164            ],
165        },
166        windows: {
167            enabled: true,
168            cflags: [
169                "-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR",
170                "-Wno-null-arithmetic",
171                "-Wno-sign-compare",
172                "-Wno-tautological-pointer-compare",
173                "-Wno-unknown-pragmas",
174            ],
175            static_libs: ["libcompiler_rt-extras"],
176        },
177    },
178
179    export_include_dirs: ["source"],
180}
181
182// dng sdk validating version static library
183// This version will print out validation warnings/errors to stderr
184// and is built against the NDK for use with CTS
185// ========================================================
186
187cc_library_static {
188    name: "libdng_sdk_validate",
189    defaults: ["libdng_sdk-defaults"],
190
191    cflags: ["-DqDNGValidate=1"],
192
193    static_libs: ["libjpeg_static_ndk"],
194    shared_libs: ["libz"],
195
196    export_include_dirs: ["source"],
197
198    sdk_version: "24",
199    stl: "c++_static",
200}
201
202// dng sdk unittests for target
203// ========================================================
204
205cc_binary {
206    name: "dng_validate",
207    defaults: ["libdng_sdk-defaults"],
208    srcs: ["source/dng_validate.cpp"],
209
210    cflags: ["-DqDNGValidate=1"],
211
212    shared_libs: [
213        "libz",
214        "libjpeg",
215    ],
216}
217
218cc_binary_host {
219    name: "dng_validate_host",
220    defaults: ["libdng_sdk-defaults"],
221    srcs: ["source/dng_validate.cpp"],
222
223    cflags: ["-DqDNGValidate=1"],
224
225    shared_libs: [
226        "libz",
227        "libjpeg",
228    ],
229
230    target: {
231        darwin: {
232            enabled: false, // b/67474260
233        },
234    },
235}
236