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
5config("cld_config") {
6  defines = [ "CLD_WINDOWS" ]
7  include_dirs = [ "." ]
8}
9
10static_library("cld") {
11  # This target includes its own copy of "base" which confuses the header
12  # checker.
13  check_includes = false
14
15  sources = [
16    "encodings/compact_lang_det/cldutil.cc",
17    "encodings/compact_lang_det/cldutil.h",
18    "encodings/compact_lang_det/cldutil_dbg.h",
19    "encodings/compact_lang_det/cldutil_dbg_empty.cc",
20    "encodings/compact_lang_det/compact_lang_det.cc",
21    "encodings/compact_lang_det/compact_lang_det.h",
22    "encodings/compact_lang_det/compact_lang_det_impl.cc",
23    "encodings/compact_lang_det/compact_lang_det_impl.h",
24    "encodings/compact_lang_det/ext_lang_enc.cc",
25    "encodings/compact_lang_det/ext_lang_enc.h",
26    "encodings/compact_lang_det/getonescriptspan.cc",
27    "encodings/compact_lang_det/getonescriptspan.h",
28    "encodings/compact_lang_det/letterscript_enum.cc",
29    "encodings/compact_lang_det/letterscript_enum.h",
30    "encodings/compact_lang_det/string_byte_sink.cc",
31    "encodings/compact_lang_det/string_byte_sink.h",
32    "encodings/compact_lang_det/subsetsequence.cc",
33    "encodings/compact_lang_det/subsetsequence.h",
34    "encodings/compact_lang_det/tote.cc",
35    "encodings/compact_lang_det/tote.h",
36    "encodings/compact_lang_det/utf8propjustletter.h",
37    "encodings/compact_lang_det/utf8propletterscriptnum.h",
38    "encodings/compact_lang_det/utf8scannotjustletterspecial.h",
39    "encodings/compact_lang_det/generated/cld_generated_score_quadchrome_0406.cc",
40    "encodings/compact_lang_det/generated/compact_lang_det_generated_cjkbis_0.cc",
41    "encodings/compact_lang_det/generated/compact_lang_det_generated_ctjkvz.cc",
42    "encodings/compact_lang_det/generated/compact_lang_det_generated_deltaoctachrome.cc",
43    "encodings/compact_lang_det/generated/compact_lang_det_generated_meanscore.h",
44    "encodings/compact_lang_det/generated/compact_lang_det_generated_quadschrome.cc",
45    "encodings/compact_lang_det/win/cld_basictypes.h",
46    "encodings/compact_lang_det/win/cld_commandlineflags.h",
47    "encodings/compact_lang_det/win/cld_google.h",
48    "encodings/compact_lang_det/win/cld_htmlutils.h",
49    "encodings/compact_lang_det/win/cld_htmlutils_windows.cc",
50    "encodings/compact_lang_det/win/cld_logging.h",
51    "encodings/compact_lang_det/win/cld_macros.h",
52    "encodings/compact_lang_det/win/cld_strtoint.h",
53    "encodings/compact_lang_det/win/cld_unicodetext.cc",
54    "encodings/compact_lang_det/win/cld_unicodetext.h",
55    "encodings/compact_lang_det/win/cld_unilib.h",
56    "encodings/compact_lang_det/win/cld_unilib_windows.cc",
57    "encodings/compact_lang_det/win/cld_utf.h",
58    "encodings/compact_lang_det/win/cld_utf8statetable.cc",
59    "encodings/compact_lang_det/win/cld_utf8statetable.h",
60    "encodings/compact_lang_det/win/cld_utf8utils.h",
61    "encodings/compact_lang_det/win/cld_utf8utils_windows.cc",
62    "encodings/internal/encodings.cc",
63    "encodings/proto/encodings.pb.h",
64    "encodings/public/encodings.h",
65    "languages/internal/languages.cc",
66    "languages/proto/languages.pb.h",
67    "languages/public/languages.h",
68    "base/basictypes.h",
69    "base/build_config.h",
70    "base/casts.h",
71    "base/commandlineflags.h",
72    "base/global_strip_options.h",
73    "base/logging.h",
74    "base/macros.h",
75    "base/port.h",
76    "base/crash.h",
77    "base/dynamic_annotations.h",
78    "base/scoped_ptr.h",
79    "base/stl_decl_msvc.h",
80    "base/log_severity.h",
81    "base/strtoint.h",
82    "base/vlog_is_on.h",
83    "base/string_util.h",
84    "base/type_traits.h",
85    "base/template_util.h",
86  ]
87
88  configs -= [
89    # We have conflicting versions of some base files.
90    "//build/config/compiler:default_include_dirs",
91    "//build/config/compiler:chromium_code",
92  ]
93  configs += [ "//build/config/compiler:no_chromium_code" ]
94  public_configs = [ ":cld_config" ]
95
96  if (is_win) {
97    defines = [ "COMPILER_MSVC" ]
98    cflags = [
99      "/wd4005",  # Macro defined twice.
100      "/wd4006",  # #undef expected an identifier.
101      "/wd4309",  # Truncation of constant value.
102      "/wd4267",  # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int
103    ]
104  } else {
105    defines = [ "COMPILER_GCC" ]
106  }
107
108  public_deps = [
109    "//third_party/icu:icuuc",
110  ]
111}
112