blob: 3c1600621417ba12d3ada361cddd39d45c040656 [file] [log] [blame]
# This file will be copied into //third_party/externals/dng_sdk via the new_local_repository
# rule in WORKSPACE.bazel, so all files should be relative to that path.
load("@bazel_skylib//lib:selects.bzl", "selects")
cc_library(
name = "dng_sdk",
srcs = [
"source/dng_1d_function.cpp",
"source/dng_1d_table.cpp",
"source/dng_abort_sniffer.cpp",
"source/dng_area_task.cpp",
"source/dng_bad_pixels.cpp",
"source/dng_bottlenecks.cpp",
"source/dng_camera_profile.cpp",
"source/dng_color_space.cpp",
"source/dng_color_spec.cpp",
"source/dng_date_time.cpp",
"source/dng_exceptions.cpp",
"source/dng_exif.cpp",
"source/dng_file_stream.cpp",
"source/dng_filter_task.cpp",
"source/dng_fingerprint.cpp",
"source/dng_gain_map.cpp",
"source/dng_globals.cpp",
"source/dng_host.cpp",
"source/dng_hue_sat_map.cpp",
"source/dng_ifd.cpp",
"source/dng_image.cpp",
"source/dng_image_writer.cpp",
"source/dng_info.cpp",
"source/dng_iptc.cpp",
"source/dng_jpeg_image.cpp",
"source/dng_jpeg_memory_source.cpp",
"source/dng_lens_correction.cpp",
"source/dng_linearization_info.cpp",
"source/dng_lossless_jpeg.cpp",
"source/dng_matrix.cpp",
"source/dng_memory.cpp",
"source/dng_memory_stream.cpp",
"source/dng_misc_opcodes.cpp",
"source/dng_mosaic_info.cpp",
"source/dng_mutex.cpp",
"source/dng_negative.cpp",
"source/dng_opcode_list.cpp",
"source/dng_opcodes.cpp",
"source/dng_orientation.cpp",
"source/dng_parse_utils.cpp",
"source/dng_pixel_buffer.cpp",
"source/dng_point.cpp",
"source/dng_preview.cpp",
"source/dng_pthread.cpp",
"source/dng_rational.cpp",
"source/dng_read_image.cpp",
"source/dng_rect.cpp",
"source/dng_ref_counted_block.cpp",
"source/dng_reference.cpp",
"source/dng_render.cpp",
"source/dng_resample.cpp",
"source/dng_safe_arithmetic.cpp",
"source/dng_shared.cpp",
"source/dng_simple_image.cpp",
"source/dng_spline.cpp",
"source/dng_stream.cpp",
"source/dng_string.cpp",
"source/dng_string_list.cpp",
"source/dng_tag_types.cpp",
"source/dng_temperature.cpp",
"source/dng_tile_iterator.cpp",
"source/dng_tone_curve.cpp",
"source/dng_utils.cpp",
"source/dng_xy_coord.cpp",
],
hdrs = [
"source/RawEnvironment.h",
"source/dng_1d_function.h",
"source/dng_1d_table.h",
"source/dng_abort_sniffer.h",
"source/dng_area_task.h",
"source/dng_assertions.h",
"source/dng_auto_ptr.h",
"source/dng_bad_pixels.h",
"source/dng_bottlenecks.h",
"source/dng_camera_profile.h",
"source/dng_classes.h",
"source/dng_color_space.h",
"source/dng_color_spec.h",
"source/dng_date_time.h",
"source/dng_errors.h",
"source/dng_exceptions.h",
"source/dng_exif.h",
"source/dng_fast_module.h",
"source/dng_file_stream.h",
"source/dng_filter_task.h",
"source/dng_fingerprint.h",
"source/dng_flags.h",
"source/dng_gain_map.h",
"source/dng_globals.h",
"source/dng_host.h",
"source/dng_hue_sat_map.h",
"source/dng_ifd.h",
"source/dng_image.h",
"source/dng_image_writer.h",
"source/dng_info.h",
"source/dng_iptc.h",
"source/dng_jpeg_image.h",
"source/dng_jpeg_memory_source.h",
"source/dng_jpeglib.h",
"source/dng_lens_correction.h",
"source/dng_linearization_info.h",
"source/dng_lossless_jpeg.h",
"source/dng_matrix.h",
"source/dng_memory.h",
"source/dng_memory_stream.h",
"source/dng_misc_opcodes.h",
"source/dng_mosaic_info.h",
"source/dng_mutex.h",
"source/dng_negative.h",
"source/dng_opcode_list.h",
"source/dng_opcodes.h",
"source/dng_orientation.h",
"source/dng_parse_utils.h",
"source/dng_pixel_buffer.h",
"source/dng_point.h",
"source/dng_preview.h",
"source/dng_pthread.h",
"source/dng_rational.h",
"source/dng_read_image.h",
"source/dng_rect.h",
"source/dng_ref_counted_block.h",
"source/dng_reference.h",
"source/dng_render.h",
"source/dng_resample.h",
"source/dng_safe_arithmetic.h",
"source/dng_sdk_limits.h",
"source/dng_shared.h",
"source/dng_simple_image.h",
"source/dng_spline.h",
"source/dng_stream.h",
"source/dng_string.h",
"source/dng_string_list.h",
"source/dng_tag_codes.h",
"source/dng_tag_types.h",
"source/dng_tag_values.h",
"source/dng_temperature.h",
"source/dng_tile_iterator.h",
"source/dng_tone_curve.h",
"source/dng_types.h",
"source/dng_uncopyable.h",
"source/dng_utils.h",
"source/dng_xy_coord.h",
],
defines = [
"qDNGBigEndian=0", # The GN rules had this defined publicly
] + selects.with_or({
("@platforms//cpu:x86_64", "@platforms//cpu:arm"): [
# DNG SDK uses __builtin_smulll_overflow() to detect 64x64 bit multiply overflow.
# On some platforms, the compiler implements this with __mulodi4().
# I can't quite figure out how to link that here, so instead here's a shim for
# __builtin_smulll_overflow() that multiplies normally assuming no overflow.
# Previously tracked in b/29412086.
# Currently, without this define, we see:
# Error: cannot initialize a parameter of type 'long long *' with an rvalue of type 'std::int64_t *' (aka 'long *')
"__builtin_smulll_overflow(x,y,p)=(*(p)=(x)*(y),false)",
],
"//conditions:default": [],
}),
includes = ["source"],
local_defines = [
"qDNGReportErrors=0",
"qDNGThreadSafe=1",
"qDNGUseLibJPEG=1",
"qDNGUseXMP=0",
"qDNGValidate=0",
"qDNGValidateTarget=1",
"UNIX_ENV=1",
],
visibility = ["//visibility:public"],
deps = [
"@libjpeg_turbo",
"@zlib_skia//:zlib",
],
)