1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 { 6 'variables': { 7 'conditions': [ 8 ['OS == "linux" and chromeos==0', { 9 'use_system_libexif%': 1, 10 }, { # OS != "linux" and chromeos==0 11 'use_system_libexif%': 0, 12 }], 13 ], 14 }, 15 'conditions': [ 16 ['use_system_libexif==0', { 17 'targets': [ 18 { 19 'target_name': 'libexif', 20 'type': 'loadable_module', 21 'sources': [ 22 'sources/libexif/exif-byte-order.c', 23 'sources/libexif/exif-content.c', 24 'sources/libexif/exif-data.c', 25 'sources/libexif/exif-entry.c', 26 'sources/libexif/exif-format.c', 27 'sources/libexif/exif-ifd.c', 28 'sources/libexif/exif-loader.c', 29 'sources/libexif/exif-log.c', 30 'sources/libexif/exif-mem.c', 31 'sources/libexif/exif-mnote-data.c', 32 'sources/libexif/exif-tag.c', 33 'sources/libexif/exif-utils.c', 34 'sources/libexif/canon/exif-mnote-data-canon.c', 35 'sources/libexif/canon/mnote-canon-entry.c', 36 'sources/libexif/canon/mnote-canon-tag.c', 37 'sources/libexif/fuji/exif-mnote-data-fuji.c', 38 'sources/libexif/fuji/mnote-fuji-entry.c', 39 'sources/libexif/fuji/mnote-fuji-tag.c', 40 'sources/libexif/olympus/exif-mnote-data-olympus.c', 41 'sources/libexif/olympus/mnote-olympus-entry.c', 42 'sources/libexif/olympus/mnote-olympus-tag.c', 43 'sources/libexif/pentax/exif-mnote-data-pentax.c', 44 'sources/libexif/pentax/mnote-pentax-entry.c', 45 'sources/libexif/pentax/mnote-pentax-tag.c', 46 ], 47 'include_dirs': [ 48 'sources', 49 ], 50 'direct_dependent_settings': { 51 'include_dirs': [ 52 'sources', 53 ], 54 }, 55 'variables': { 56 'clang_warning_flags': [ 57 '-Wno-enum-conversion', 58 '-Wno-switch', 59 '-Wno-format', 60 # libexif uses fabs(int) to cast to float. 61 '-Wno-absolute-value', 62 ], 63 }, 64 'conditions': [ 65 ['os_posix==1 and OS!="mac"', { 66 'cflags!': ['-fvisibility=hidden'], 67 }], 68 ['OS=="mac"', { 69 'conditions': [ 70 ['mac_breakpad==1', { 71 'variables': { 72 'mac_real_dsym': 1, 73 }, 74 }], 75 ], 76 'xcode_settings': { 77 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', # no -fvisibility=hidden 78 }, 79 }], 80 ['OS=="win"', { 81 'product_name': 'libexif', 82 'sources': [ 83 'libexif.def', 84 ], 85 'defines': [ 86 # This seems like a hack, but this is what WebKit Win does. 87 'snprintf=_snprintf', 88 'inline=__inline', 89 ], 90 'msvs_disabled_warnings': [ 91 4018, # size/unsigned mismatch 92 4267, # size_t -> ExifLong truncation on amd64 93 ], 94 }], 95 ], 96 }, 97 ], 98 }, { # 'use_system_libexif!=0 99 'conditions': [ 100 ['sysroot!=""', { 101 'variables': { 102 'pkg-config': '../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"', 103 }, 104 }, { 105 'variables': { 106 'pkg-config': 'pkg-config' 107 }, 108 }], 109 ], 110 'targets': [ 111 { 112 'target_name': 'libexif', 113 'type': 'none', 114 'direct_dependent_settings': { 115 'cflags': [ 116 '<!@(<(pkg-config) --cflags libexif)', 117 ], 118 'defines': [ 119 'USE_SYSTEM_LIBEXIF', 120 ], 121 }, 122 } 123 ], 124 }], 125 ] 126 } 127