OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//testing/test.gni") | 5 import("//testing/test.gni") |
6 | 6 |
7 config("ced_config") { | 7 config("ced_config") { |
8 include_dirs = [ "src" ] | 8 include_dirs = [ "src" ] |
| 9 } |
| 10 |
| 11 config("ced_config_private") { |
| 12 # This cannot be set directly on the "ced" and "ced_unittests" target because |
| 13 # the target cflags property is added to the command-line before the cflags |
| 14 # property from its config. For configs, the cflags property are set in the |
| 15 # order public_configs, configs thus it is correctly set after the flag that |
| 16 # enable the error. |
9 if (is_clang) { | 17 if (is_clang) { |
10 cflags = [ "-Wno-unused-function" ] | 18 cflags = [ "-Wno-unused-function" ] |
11 } | 19 } |
12 } | 20 } |
13 | 21 |
14 static_library("ced") { | 22 static_library("ced") { |
15 sources = [ | 23 sources = [ |
16 # find src -maxdepth 3 ! -type d | egrep '\.(h|cc)$' | grep -v test.cc |\ | 24 # find src -maxdepth 3 ! -type d | egrep '\.(h|cc)$' | grep -v test.cc |\ |
17 # LC_COLLATE=c sort | sed 's/^\(.*\)$/ "\1",/' | 25 # LC_COLLATE=c sort | sed 's/^\(.*\)$/ "\1",/' |
18 "src/compact_enc_det/compact_enc_det.cc", | 26 "src/compact_enc_det/compact_enc_det.cc", |
(...skipping 12 matching lines...) Expand all Loading... |
31 "src/util/languages/languages.pb.h", | 39 "src/util/languages/languages.pb.h", |
32 "src/util/logging.h", | 40 "src/util/logging.h", |
33 "src/util/port.h", | 41 "src/util/port.h", |
34 "src/util/string_util.h", | 42 "src/util/string_util.h", |
35 "src/util/varsetter.h", | 43 "src/util/varsetter.h", |
36 ] | 44 ] |
37 public = [ | 45 public = [ |
38 "src/compact_enc_det/compact_enc_det.h", | 46 "src/compact_enc_det/compact_enc_det.h", |
39 ] | 47 ] |
40 configs -= [ "//build/config/compiler:chromium_code" ] | 48 configs -= [ "//build/config/compiler:chromium_code" ] |
41 configs += [ "//build/config/compiler:no_chromium_code" ] | 49 configs += [ |
| 50 "//build/config/compiler:no_chromium_code", |
| 51 ":ced_config_private", |
| 52 ] |
42 | 53 |
43 public_configs = [ ":ced_config" ] | 54 public_configs = [ ":ced_config" ] |
44 | 55 |
45 if (is_win) { | 56 if (is_win) { |
46 defines = [ "COMPILER_MSVC" ] | 57 defines = [ "COMPILER_MSVC" ] |
47 cflags = [ | 58 cflags = [ |
48 "/wd4005", # Macro defined twice. | 59 "/wd4005", # Macro defined twice. |
49 "/wd4006", # #undef expected an identifier. | 60 "/wd4006", # #undef expected an identifier. |
50 "/wd4018", # '<': signed/unsigned mismatch | 61 "/wd4018", # '<': signed/unsigned mismatch |
51 "/wd4309", # Truncation of constant value. | 62 "/wd4309", # Truncation of constant value. |
52 ] | 63 ] |
53 } else { | 64 } else { |
54 defines = [ "COMPILER_GCC" ] | 65 defines = [ "COMPILER_GCC" ] |
55 } | 66 } |
56 } | 67 } |
57 | 68 |
58 test("ced_unittests") { | 69 test("ced_unittests") { |
59 sources = [ | 70 sources = [ |
60 "src/compact_enc_det/compact_enc_det_fuzz_test.cc", | 71 "src/compact_enc_det/compact_enc_det_fuzz_test.cc", |
61 "src/compact_enc_det/compact_enc_det_unittest.cc", | 72 "src/compact_enc_det/compact_enc_det_unittest.cc", |
62 "src/compact_enc_det/detail_head_string.inc", | 73 "src/compact_enc_det/detail_head_string.inc", |
63 "src/util/encodings/encodings_unittest.cc", | 74 "src/util/encodings/encodings_unittest.cc", |
64 ] | 75 ] |
65 | 76 |
| 77 configs += [ ":ced_config_private" ] |
| 78 |
66 if (is_win) { | 79 if (is_win) { |
67 defines = [ "COMPILER_MSVC" ] | 80 defines = [ "COMPILER_MSVC" ] |
68 cflags = [ | 81 cflags = [ |
69 "/wd4310", # Truncation of constant value. | 82 "/wd4310", # Truncation of constant value. |
70 "/wd4267", # size_t -> int | 83 "/wd4267", # size_t -> int |
71 ] | 84 ] |
72 } else { | 85 } else { |
73 defines = [ "COMPILER_GCC" ] | 86 defines = [ "COMPILER_GCC" ] |
74 } | 87 } |
75 | 88 |
76 deps = [ | 89 deps = [ |
77 ":ced", | 90 ":ced", |
78 "//testing/gtest", | 91 "//testing/gtest", |
79 "//testing/gtest:gtest_main", | 92 "//testing/gtest:gtest_main", |
80 ] | 93 ] |
81 } | 94 } |
OLD | NEW |