Home | History | Annotate | Download | only in harfbuzz-ng
      1 # Copyright 2014 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 # The GYP build supports system harfbuzz for non-official builds when using
      6 # pangoft2 1.31.0 or greater (which pulls it in).
      7 # TODO(brettw) we can consider doing this as well, although the benefit is
      8 # unclear and requires shelling out to a script to check the version.
      9 #
     10 # ChromeOS uses an up-to-date system one that we have control over, so we
     11 # don't want to bloat the binary more by including another copy.
     12 
     13 declare_args() {
     14   use_system_harfbuzz = is_chromeos
     15 }
     16 
     17 if (use_system_harfbuzz) {
     18   import("//build/config/linux/pkg_config.gni")
     19   pkg_config("harfbuzz_pkgconfig") {
     20     packages = [ "harfbuzz" ]
     21   }
     22   group("harfbuzz-ng") {
     23     public_configs = [ ":harfbuzz_pkgconfig" ]
     24   }
     25 
     26 } else {
     27   config("harfbuzz-ng_config") {
     28     include_dirs = [ "src" ]
     29   }
     30 
     31   source_set("harfbuzz-ng") {
     32     sources = [
     33       "src/hb-atomic-private.hh",
     34       "src/hb-blob.cc",
     35       "src/hb-blob.h",
     36       "src/hb-buffer.cc",
     37       "src/hb-buffer-deserialize-json.hh",
     38       "src/hb-buffer-deserialize-text.hh",
     39       "src/hb-buffer.h",
     40       "src/hb-buffer-private.hh",
     41       "src/hb-buffer-serialize.cc",
     42       "src/hb-cache-private.hh",
     43       "src/hb-common.cc",
     44       "src/hb-common.h",
     45       "src/hb-deprecated.h",
     46       "src/hb-face.cc",
     47       "src/hb-face.h",
     48       "src/hb-face-private.hh",
     49       "src/hb-fallback-shape.cc",
     50       "src/hb-font.cc",
     51       "src/hb-font.h",
     52       "src/hb-font-private.hh",
     53       "src/hb.h",
     54       "src/hb-icu.cc",
     55       "src/hb-icu.h",
     56       "src/hb-mutex-private.hh",
     57       "src/hb-object-private.hh",
     58       "src/hb-open-file-private.hh",
     59       "src/hb-open-type-private.hh",
     60       "src/hb-ot.h",
     61       "src/hb-ot-head-table.hh",
     62       "src/hb-ot-hhea-table.hh",
     63       "src/hb-ot-hmtx-table.hh",
     64       "src/hb-ot-layout.cc",
     65       "src/hb-ot-layout-common-private.hh",
     66       "src/hb-ot-layout-gdef-table.hh",
     67       "src/hb-ot-layout-gpos-table.hh",
     68       "src/hb-ot-layout-gsubgpos-private.hh",
     69       "src/hb-ot-layout-gsub-table.hh",
     70       "src/hb-ot-layout.h",
     71       "src/hb-ot-layout-private.hh",
     72       "src/hb-ot-map.cc",
     73       "src/hb-ot-map-private.hh",
     74       "src/hb-ot-maxp-table.hh",
     75       "src/hb-ot-name-table.hh",
     76       "src/hb-ot-shape.cc",
     77       "src/hb-ot-shape-complex-arabic.cc",
     78       "src/hb-ot-shape-complex-arabic-fallback.hh",
     79       "src/hb-ot-shape-complex-arabic-table.hh",
     80       "src/hb-ot-shape-complex-default.cc",
     81       "src/hb-ot-shape-complex-hangul.cc",
     82       "src/hb-ot-shape-complex-hebrew.cc",
     83       "src/hb-ot-shape-complex-indic.cc",
     84       "src/hb-ot-shape-complex-indic-machine.hh",
     85       "src/hb-ot-shape-complex-indic-private.hh",
     86       "src/hb-ot-shape-complex-indic-table.cc",
     87       "src/hb-ot-shape-complex-myanmar.cc",
     88       "src/hb-ot-shape-complex-myanmar-machine.hh",
     89       "src/hb-ot-shape-complex-private.hh",
     90       "src/hb-ot-shape-complex-sea.cc",
     91       "src/hb-ot-shape-complex-sea-machine.hh",
     92       "src/hb-ot-shape-complex-thai.cc",
     93       "src/hb-ot-shape-complex-tibetan.cc",
     94       "src/hb-ot-shape-fallback.cc",
     95       "src/hb-ot-shape-fallback-private.hh",
     96       "src/hb-ot-shape.h",
     97       "src/hb-ot-shape-normalize.cc",
     98       "src/hb-ot-shape-normalize-private.hh",
     99       "src/hb-ot-shape-private.hh",
    100       "src/hb-ot-tag.cc",
    101       "src/hb-ot-tag.h",
    102       "src/hb-private.hh",
    103       "src/hb-set.cc",
    104       "src/hb-set.h",
    105       "src/hb-set-private.hh",
    106       "src/hb-shape.cc",
    107       "src/hb-shape.h",
    108       "src/hb-shape-plan.cc",
    109       "src/hb-shape-plan.h",
    110       "src/hb-shape-plan-private.hh",
    111       "src/hb-shaper.cc",
    112       "src/hb-shaper-impl-private.hh",
    113       "src/hb-shaper-list.hh",
    114       "src/hb-shaper-private.hh",
    115       "src/hb-unicode.cc",
    116       "src/hb-unicode.h",
    117       "src/hb-unicode-private.hh",
    118       "src/hb-utf-private.hh",
    119       "src/hb-version.h",
    120       "src/hb-warning.cc",
    121     ]
    122 
    123     defines = [
    124       "HAVE_OT",
    125       "HAVE_ICU",
    126       "HAVE_ICU_BUILTIN",
    127       "HB_NO_MT",
    128     ]
    129 
    130     configs -= [ "//build/config/compiler:chromium_code" ]
    131     configs += [ "//build/config/compiler:no_chromium_code" ]
    132     public_configs = [ ":harfbuzz-ng_config" ]
    133 
    134     deps = [
    135       "//third_party/icu:icuuc",
    136     ]
    137 
    138     cflags = []
    139     if (is_clang) {
    140       cflags += [ "-Wno-unused-value" ]
    141     }
    142     if (is_win) {
    143       cflags += [
    144         "/wd4267",  # size_t to 'type' converion.
    145         "/wd4334",  # Result of 32-bit shift implicitly converted to 64 bits.
    146       ]
    147     }
    148     if (is_mac) {
    149       sources += [
    150         "src/hb-coretext.cc",
    151         "src/hb-coretext.h",
    152       ]
    153       defines += [ "HAVE_CORETEXT" ]
    154     }
    155   }
    156 }
    157