Home | History | Annotate | Download | only in dng_sdk
      1 # Copyright 2016 Google Inc.
      2 #
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 # The Adobe DNG SDK, an API for reading and writing DNG files.
      6 
      7 declare_args() {
      8 }
      9 
     10 import("../third_party.gni")
     11 
     12 third_party("dng_sdk") {
     13   public_include_dirs = [ "../externals/dng_sdk/source" ]
     14 
     15   configs -= [
     16     "//gn:no_exceptions",
     17     "//gn:no_rtti",
     18   ]
     19 
     20   public_defines = [ "qDNGBigEndian=0" ]
     21 
     22   defines = [
     23     "qDNGReportErrors=0",
     24     "qDNGThreadSafe=1",
     25     "qDNGUseLibJPEG=1",
     26     "qDNGUseXMP=0",
     27     "qDNGValidate=0",
     28     "qDNGValidateTarget=1",
     29     "UNIX_ENV=1",
     30   ]
     31 
     32   deps = [
     33     "//third_party/libjpeg-turbo:libjpeg",
     34     "//third_party/zlib",
     35   ]
     36 
     37   sources = [
     38     "../externals/dng_sdk/source/RawEnvironment.h",
     39     "../externals/dng_sdk/source/dng_1d_function.cpp",
     40     "../externals/dng_sdk/source/dng_1d_function.h",
     41     "../externals/dng_sdk/source/dng_1d_table.cpp",
     42     "../externals/dng_sdk/source/dng_1d_table.h",
     43     "../externals/dng_sdk/source/dng_abort_sniffer.cpp",
     44     "../externals/dng_sdk/source/dng_abort_sniffer.h",
     45     "../externals/dng_sdk/source/dng_area_task.cpp",
     46     "../externals/dng_sdk/source/dng_area_task.h",
     47     "../externals/dng_sdk/source/dng_assertions.h",
     48     "../externals/dng_sdk/source/dng_auto_ptr.h",
     49     "../externals/dng_sdk/source/dng_bad_pixels.cpp",
     50     "../externals/dng_sdk/source/dng_bad_pixels.h",
     51     "../externals/dng_sdk/source/dng_bottlenecks.cpp",
     52     "../externals/dng_sdk/source/dng_bottlenecks.h",
     53     "../externals/dng_sdk/source/dng_camera_profile.cpp",
     54     "../externals/dng_sdk/source/dng_camera_profile.h",
     55     "../externals/dng_sdk/source/dng_classes.h",
     56     "../externals/dng_sdk/source/dng_color_space.cpp",
     57     "../externals/dng_sdk/source/dng_color_space.h",
     58     "../externals/dng_sdk/source/dng_color_spec.cpp",
     59     "../externals/dng_sdk/source/dng_color_spec.h",
     60     "../externals/dng_sdk/source/dng_date_time.cpp",
     61     "../externals/dng_sdk/source/dng_date_time.h",
     62     "../externals/dng_sdk/source/dng_errors.h",
     63     "../externals/dng_sdk/source/dng_exceptions.cpp",
     64     "../externals/dng_sdk/source/dng_exceptions.h",
     65     "../externals/dng_sdk/source/dng_exif.cpp",
     66     "../externals/dng_sdk/source/dng_exif.h",
     67     "../externals/dng_sdk/source/dng_fast_module.h",
     68     "../externals/dng_sdk/source/dng_file_stream.cpp",
     69     "../externals/dng_sdk/source/dng_file_stream.h",
     70     "../externals/dng_sdk/source/dng_filter_task.cpp",
     71     "../externals/dng_sdk/source/dng_filter_task.h",
     72     "../externals/dng_sdk/source/dng_fingerprint.cpp",
     73     "../externals/dng_sdk/source/dng_fingerprint.h",
     74     "../externals/dng_sdk/source/dng_flags.h",
     75     "../externals/dng_sdk/source/dng_gain_map.cpp",
     76     "../externals/dng_sdk/source/dng_gain_map.h",
     77     "../externals/dng_sdk/source/dng_globals.cpp",
     78     "../externals/dng_sdk/source/dng_globals.h",
     79     "../externals/dng_sdk/source/dng_host.cpp",
     80     "../externals/dng_sdk/source/dng_host.h",
     81     "../externals/dng_sdk/source/dng_hue_sat_map.cpp",
     82     "../externals/dng_sdk/source/dng_hue_sat_map.h",
     83     "../externals/dng_sdk/source/dng_ifd.cpp",
     84     "../externals/dng_sdk/source/dng_ifd.h",
     85     "../externals/dng_sdk/source/dng_image.cpp",
     86     "../externals/dng_sdk/source/dng_image.h",
     87     "../externals/dng_sdk/source/dng_image_writer.cpp",
     88     "../externals/dng_sdk/source/dng_image_writer.h",
     89     "../externals/dng_sdk/source/dng_info.cpp",
     90     "../externals/dng_sdk/source/dng_info.h",
     91     "../externals/dng_sdk/source/dng_iptc.cpp",
     92     "../externals/dng_sdk/source/dng_iptc.h",
     93     "../externals/dng_sdk/source/dng_jpeg_image.cpp",
     94     "../externals/dng_sdk/source/dng_jpeg_image.h",
     95     "../externals/dng_sdk/source/dng_jpeg_memory_source.cpp",
     96     "../externals/dng_sdk/source/dng_jpeg_memory_source.h",
     97     "../externals/dng_sdk/source/dng_jpeglib.h",
     98     "../externals/dng_sdk/source/dng_lens_correction.cpp",
     99     "../externals/dng_sdk/source/dng_lens_correction.h",
    100     "../externals/dng_sdk/source/dng_linearization_info.cpp",
    101     "../externals/dng_sdk/source/dng_linearization_info.h",
    102     "../externals/dng_sdk/source/dng_lossless_jpeg.cpp",
    103     "../externals/dng_sdk/source/dng_lossless_jpeg.h",
    104     "../externals/dng_sdk/source/dng_matrix.cpp",
    105     "../externals/dng_sdk/source/dng_matrix.h",
    106     "../externals/dng_sdk/source/dng_memory.cpp",
    107     "../externals/dng_sdk/source/dng_memory.h",
    108     "../externals/dng_sdk/source/dng_memory_stream.cpp",
    109     "../externals/dng_sdk/source/dng_memory_stream.h",
    110     "../externals/dng_sdk/source/dng_misc_opcodes.cpp",
    111     "../externals/dng_sdk/source/dng_misc_opcodes.h",
    112     "../externals/dng_sdk/source/dng_mosaic_info.cpp",
    113     "../externals/dng_sdk/source/dng_mosaic_info.h",
    114     "../externals/dng_sdk/source/dng_mutex.cpp",
    115     "../externals/dng_sdk/source/dng_mutex.h",
    116     "../externals/dng_sdk/source/dng_negative.cpp",
    117     "../externals/dng_sdk/source/dng_negative.h",
    118     "../externals/dng_sdk/source/dng_opcode_list.cpp",
    119     "../externals/dng_sdk/source/dng_opcode_list.h",
    120     "../externals/dng_sdk/source/dng_opcodes.cpp",
    121     "../externals/dng_sdk/source/dng_opcodes.h",
    122     "../externals/dng_sdk/source/dng_orientation.cpp",
    123     "../externals/dng_sdk/source/dng_orientation.h",
    124     "../externals/dng_sdk/source/dng_parse_utils.cpp",
    125     "../externals/dng_sdk/source/dng_parse_utils.h",
    126     "../externals/dng_sdk/source/dng_pixel_buffer.cpp",
    127     "../externals/dng_sdk/source/dng_pixel_buffer.h",
    128     "../externals/dng_sdk/source/dng_point.cpp",
    129     "../externals/dng_sdk/source/dng_point.h",
    130     "../externals/dng_sdk/source/dng_preview.cpp",
    131     "../externals/dng_sdk/source/dng_preview.h",
    132     "../externals/dng_sdk/source/dng_pthread.cpp",
    133     "../externals/dng_sdk/source/dng_pthread.h",
    134     "../externals/dng_sdk/source/dng_rational.cpp",
    135     "../externals/dng_sdk/source/dng_rational.h",
    136     "../externals/dng_sdk/source/dng_read_image.cpp",
    137     "../externals/dng_sdk/source/dng_read_image.h",
    138     "../externals/dng_sdk/source/dng_rect.cpp",
    139     "../externals/dng_sdk/source/dng_rect.h",
    140     "../externals/dng_sdk/source/dng_ref_counted_block.cpp",
    141     "../externals/dng_sdk/source/dng_ref_counted_block.h",
    142     "../externals/dng_sdk/source/dng_reference.cpp",
    143     "../externals/dng_sdk/source/dng_reference.h",
    144     "../externals/dng_sdk/source/dng_render.cpp",
    145     "../externals/dng_sdk/source/dng_render.h",
    146     "../externals/dng_sdk/source/dng_resample.cpp",
    147     "../externals/dng_sdk/source/dng_resample.h",
    148     "../externals/dng_sdk/source/dng_safe_arithmetic.cpp",
    149     "../externals/dng_sdk/source/dng_safe_arithmetic.h",
    150     "../externals/dng_sdk/source/dng_sdk_limits.h",
    151     "../externals/dng_sdk/source/dng_shared.cpp",
    152     "../externals/dng_sdk/source/dng_shared.h",
    153     "../externals/dng_sdk/source/dng_simple_image.cpp",
    154     "../externals/dng_sdk/source/dng_simple_image.h",
    155     "../externals/dng_sdk/source/dng_spline.cpp",
    156     "../externals/dng_sdk/source/dng_spline.h",
    157     "../externals/dng_sdk/source/dng_stream.cpp",
    158     "../externals/dng_sdk/source/dng_stream.h",
    159     "../externals/dng_sdk/source/dng_string.cpp",
    160     "../externals/dng_sdk/source/dng_string.h",
    161     "../externals/dng_sdk/source/dng_string_list.cpp",
    162     "../externals/dng_sdk/source/dng_string_list.h",
    163     "../externals/dng_sdk/source/dng_tag_codes.h",
    164     "../externals/dng_sdk/source/dng_tag_types.cpp",
    165     "../externals/dng_sdk/source/dng_tag_types.h",
    166     "../externals/dng_sdk/source/dng_tag_values.h",
    167     "../externals/dng_sdk/source/dng_temperature.cpp",
    168     "../externals/dng_sdk/source/dng_temperature.h",
    169     "../externals/dng_sdk/source/dng_tile_iterator.cpp",
    170     "../externals/dng_sdk/source/dng_tile_iterator.h",
    171     "../externals/dng_sdk/source/dng_tone_curve.cpp",
    172     "../externals/dng_sdk/source/dng_tone_curve.h",
    173     "../externals/dng_sdk/source/dng_types.h",
    174     "../externals/dng_sdk/source/dng_uncopyable.h",
    175     "../externals/dng_sdk/source/dng_utils.cpp",
    176     "../externals/dng_sdk/source/dng_utils.h",
    177     "../externals/dng_sdk/source/dng_xy_coord.cpp",
    178     "../externals/dng_sdk/source/dng_xy_coord.h",
    179   ]
    180 
    181   if (current_cpu == "x86" || current_cpu == "arm") {
    182     # DNG SDK uses __builtin_smulll_overflow() to detect 64x64 bit multiply overflow.
    183     # On some platforms, the compiler implements this with __mulodi4().
    184     # I can't quite figure out how to link that here, so instead here's a shim for
    185     # __builtin_smulll_overflow() that multiplies normally assuming no overflow.
    186     # Tracked in b/29412086.
    187     defines += [ "__builtin_smulll_overflow(x,y,p)=(*(p)=(x)*(y), false)" ]
    188   }
    189 }
    190