Home | History | Annotate | Download | only in cld_2
      1 # Copyright 2013 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 # Note to maintainers: In the January 2014 release (*_0122*), there are some
      6 # options for building:
      7 # Pick one quadgram file (cld2_generated_quadchrome*.cc):
      8 #   0122_16 = 160K entries, smallest size, lowest accuracy (set cld2_table_size=0)
      9 #   0122_19 = 192K entries, medium size, medium accuracy (set cld2_table_size=1)
     10 #   0122_2  = 256K entries, largest size, highest accuracy (set cld2_table_size=2)
     11 #
     12 # For the CJK bigram file (cld_generated_cjk_delta_bi*.cc), always use
     13 # cld_generated_cjk_delta_bi_4.cc, as this is intended for use with Chromium.
     14 # The _32 variant of the file is intended for applications that use the full
     15 # 175-language version of CLD2.
     16 
     17 {
     18   'target_defaults': {
     19     'conditions': [
     20       ['OS=="win"', {
     21         'msvs_disabled_warnings': [4267],
     22       }],
     23     ],
     24   },
     25   'variables': {
     26     # These sources need to be included in both static and dynamic builds as
     27     # well as the dynamic data tool.
     28     'cld2_core_sources': [
     29       'src/internal/cld2tablesummary.h',
     30       'src/internal/cldutil.cc',
     31       'src/internal/cldutil.h',
     32       'src/internal/cldutil_shared.cc',
     33       'src/internal/cldutil_shared.h',
     34       'src/internal/compact_lang_det.cc',
     35       'src/internal/compact_lang_det_hint_code.cc',
     36       'src/internal/compact_lang_det_hint_code.h',
     37       'src/internal/compact_lang_det_impl.cc',
     38       'src/internal/compact_lang_det_impl.h',
     39       'src/internal/debug.h',
     40       'src/internal/debug_empty.cc',
     41       'src/internal/fixunicodevalue.cc',
     42       'src/internal/fixunicodevalue.h',
     43       'src/internal/generated_distinct_bi_0.cc',
     44       'src/internal/generated_entities.cc',
     45       'src/internal/generated_language.cc',
     46       'src/internal/generated_language.h',
     47       'src/internal/generated_ulscript.cc',
     48       'src/internal/generated_ulscript.h',
     49       'src/internal/getonescriptspan.cc',
     50       'src/internal/getonescriptspan.h',
     51       'src/internal/integral_types.h',
     52       'src/internal/lang_script.cc',
     53       'src/internal/lang_script.h',
     54       'src/internal/langspan.h',
     55       'src/internal/offsetmap.cc',
     56       'src/internal/offsetmap.h',
     57       'src/internal/port.h',
     58       'src/internal/scoreonescriptspan.cc',
     59       'src/internal/scoreonescriptspan.h',
     60       'src/internal/stringpiece.h',
     61       'src/internal/tote.cc',
     62       'src/internal/tote.h',
     63       'src/internal/utf8prop_lettermarkscriptnum.h',
     64       'src/internal/utf8repl_lettermarklower.h',
     65       'src/internal/utf8scannot_lettermarkspecial.h',
     66       'src/internal/utf8statetable.cc',
     67       'src/internal/utf8statetable.h',
     68       'src/public/compact_lang_det.h',
     69       'src/public/encodings.h',
     70     ],
     71     'cld2_dynamic_data_loader_sources': [
     72       'src/internal/cld2_dynamic_data.h',
     73       'src/internal/cld2_dynamic_data.cc',
     74       'src/internal/cld2_dynamic_data_loader.h',
     75       'src/internal/cld2_dynamic_data_loader.cc',
     76     ],
     77     'cld2_data_sources': [
     78       'src/internal/cld2_generated_cjk_compatible.cc',
     79       'src/internal/cld2_generated_deltaoctachrome0122.cc',
     80       'src/internal/cld2_generated_distinctoctachrome0122.cc',
     81       'src/internal/cld_generated_cjk_delta_bi_4.cc',
     82       'src/internal/cld_generated_cjk_uni_prop_80.cc',
     83       'src/internal/cld_generated_score_quad_octa_0122_2.cc',
     84       'src/internal/generated_distinct_bi_0.cc',
     85     ],
     86     'conditions': [
     87       ['cld2_table_size==0', {
     88         'cld2_data_sources+': ['src/internal/cld2_generated_quadchrome0122_16.cc']
     89       }],
     90       ['cld2_table_size==1', {
     91          'cld2_data_sources+': ['src/internal/cld2_generated_quadchrome0122_19.cc']
     92       }],
     93       ['cld2_table_size==2', {
     94          'cld2_data_sources+': ['src/internal/cld2_generated_quadchrome0122_2.cc']
     95       }],
     96     ],
     97   },
     98 
     99   'targets': [
    100     {
    101       # GN version: //third_party/cld_2
    102       'target_name': 'cld_2_dynamic_data_tool',
    103       'type': 'executable',
    104       'include_dirs': [
    105         'src/internal',
    106         'src/public',
    107       ],
    108       'sources': [
    109         # Note: sources list duplicated in GN build.
    110         '<@(cld2_core_sources)',
    111         '<@(cld2_data_sources)',
    112         '<@(cld2_dynamic_data_loader_sources)',
    113         'src/internal/cld2_dynamic_data_extractor.h',
    114         'src/internal/cld2_dynamic_data_extractor.cc',
    115         'src/internal/cld2_dynamic_data_tool.cc',
    116       ],
    117     },
    118 
    119     {
    120       # GN version: //third_party/cld_2
    121       'target_name': 'cld_2',
    122       'type': 'static_library',
    123       'sources': [],
    124       'dependencies': [],
    125       'conditions': [
    126         ['cld2_data_source=="static"',
    127           {'dependencies': ['cld2_static']},
    128           {'dependencies': ['cld2_dynamic']}
    129         ],
    130       ],
    131     },
    132 
    133     {
    134       # GN version: //third_party/cld_2
    135       'target_name': 'cld2_static',
    136       'type': 'static_library',
    137       'include_dirs': [
    138         'src/internal',
    139         'src/public',
    140       ],
    141       'sources': [
    142         '<@(cld2_core_sources)',
    143         '<@(cld2_data_sources)',
    144       ],
    145     },
    146 
    147     {
    148       # GN version: //third_party/cld_2
    149       'target_name': 'cld2_dynamic',
    150       'type': 'static_library',
    151       'include_dirs': [
    152         'src/internal',
    153         'src/public',
    154       ],
    155       'sources': [
    156         '<@(cld2_core_sources)',
    157         '<@(cld2_dynamic_data_loader_sources)',
    158       ],
    159       'defines': ['CLD2_DYNAMIC_MODE'],
    160       'all_dependent_settings': {
    161         'defines': ['CLD2_DYNAMIC_MODE'],
    162       },
    163     },
    164   ],
    165 }
    166