1 # Target for building freetype. 2 { 3 'targets': [ 4 { 5 'target_name': 'freetype', 6 'type': 'none', 7 'conditions': [ 8 [ 'skia_freetype_static', 9 { 10 'dependencies': [ 11 'freetype_static' 12 ], 13 'export_dependent_settings': [ 14 'freetype_static' 15 ], 16 'conditions': [ 17 [ 'skia_os in ["android", "nacl"]', 18 { 19 'direct_dependent_settings': { 20 'defines': [ 21 # Both Android and NaCl provide at least FreeType 2.4.0 22 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400', 23 'SK_CAN_USE_DLOPEN=0', 24 ], 25 } 26 } 27 ] 28 ], 29 }, { # (not skia_freetype_static) 30 # dynamic linking depends on the OS: 31 'conditions': [ 32 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', 33 { 34 'direct_dependent_settings': { 35 'include_dirs' : [ 36 '/usr/include/freetype2', 37 ], 38 'link_settings': { 39 'libraries': [ 40 '-lfreetype', 41 ], 42 }, 43 'defines': [ 44 # The font host requires at least FreeType 2.3.0 45 # at runtime. 46 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020300', 47 'SK_CAN_USE_DLOPEN=1', 48 ], 49 } 50 }, 51 ], 52 [ 'skia_android_framework', 53 { 54 'direct_dependent_settings': { 55 'defines': [ 56 # Android provides at least FreeType 2.4.0 57 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400', 58 'SK_CAN_USE_DLOPEN=0', 59 ], 60 }, 61 'include_dirs': [ 62 'external/expat/lib', 63 'external/freetype/include', 64 ], 65 'libraries': [ 66 '-lft2', 67 ], 68 } 69 ], 70 ], 71 } 72 ], 73 ], 74 }, 75 { 76 'target_name': 'freetype_static', 77 'type': 'static_library', 78 'standalone_static_library': 1, 79 'dependencies': [ 80 # we are dependent upon PNG for color emoji glyphs 81 'libpng.gyp:libpng', 82 ], 83 'includes': [ 84 # common freetype sources needed for both the base Skia build and the 85 # libpoppler build for testing only 86 'freetype.gypi', 87 ], 88 'include_dirs': [ 89 '../third_party/freetype/include_overrides', 90 ], 91 'direct_dependent_settings': { 92 'include_dirs': [ 93 '../third_party/freetype/include_overrides', 94 ], 95 }, 96 'conditions': [ 97 [ 'skia_os == "android"', { 98 # These flags are used by the Android OS. They are probably overkill 99 # for Skia, but we add them for consistency. 100 'cflags': [ 101 '-W', 102 '-Wall', 103 '-fPIC', 104 '-DPIC', 105 '-DDARWIN_NO_CARBON', 106 '-DFT2_BUILD_LIBRARY', 107 '-O2', 108 ], 109 }], 110 ], 111 }, 112 { 113 'target_name': 'freetype_poppler', 114 'type': 'static_library', 115 'standalone_static_library': 1, 116 'includes': [ 117 'freetype.gypi', 118 ], 119 'sources': [ 120 # additional components used by poppler 121 '../third_party/externals/freetype/src/base/ftbdf.c', 122 '../third_party/externals/freetype/src/base/ftpfr.c', 123 124 '../third_party/externals/freetype/src/bdf/bdf.c', 125 '../third_party/externals/freetype/src/cid/type1cid.c', 126 '../third_party/externals/freetype/src/pcf/pcf.c', 127 '../third_party/externals/freetype/src/pfr/pfr.c', 128 '../third_party/externals/freetype/src/psaux/psaux.c', 129 '../third_party/externals/freetype/src/type1/type1.c', 130 '../third_party/externals/freetype/src/type42/type42.c', 131 '../third_party/externals/freetype/src/winfonts/winfnt.c', 132 133 '../third_party/externals/freetype/src/gzip/ftgzip.c', 134 '../third_party/externals/freetype/src/lzw/ftlzw.c', 135 ], 136 }, 137 ], 138 } 139