OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 # The list of files is kept in the .gypi. | 7 # The list of files is kept in the .gypi. |
8 gypi_values = exec_script("//build/gypi_to_gn.py", | 8 gypi_values = exec_script("//build/gypi_to_gn.py", |
9 [ rebase_path("wtf.gypi") ], | 9 [ rebase_path("wtf.gypi") ], |
10 "scope", | 10 "scope", |
11 [ "wtf.gypi" ]) | 11 [ "wtf.gypi" ]) |
12 | 12 |
13 visibility = [ "//third_party/WebKit/*" ] | 13 visibility = [ "//third_party/WebKit/*" ] |
14 | 14 |
15 config("wtf_config") { | 15 config("wtf_config") { |
16 if (is_win) { | 16 if (is_win) { |
17 defines = [ | 17 defines = [ |
18 "__STD_C", | 18 "__STD_C", |
19 "_CRT_SECURE_NO_DEPRECATE", | 19 "_CRT_SECURE_NO_DEPRECATE", |
20 "_SCL_SECURE_NO_DEPRECATE", | 20 "_SCL_SECURE_NO_DEPRECATE", |
21 ] | 21 ] |
22 include_dirs = [ | 22 include_dirs = [ "os-win32" ] |
23 "os-win32", | |
24 ] | |
25 | 23 |
26 cflags = [ | 24 cflags = [ |
27 # Don't complain about calling specific versions of templatized | 25 # Don't complain about calling specific versions of templatized |
28 # functions (e.g. in RefPtrHashMap.h). | 26 # functions (e.g. in RefPtrHashMap.h). |
29 "/wd4344", | 27 "/wd4344", |
| 28 |
30 # dtoa, icu, etc. like doing assignment within conditional. | 29 # dtoa, icu, etc. like doing assignment within conditional. |
31 "/wd4706", | 30 "/wd4706", |
32 ] | 31 ] |
33 | 32 |
34 if (is_component_build) { | 33 if (is_component_build) { |
35 # Chromium windows multi-dll build enables C++ exceptions and this causes | 34 # Chromium windows multi-dll build enables C++ exceptions and this causes |
36 # wtf to generate 4291 warning due to operator new/delete | 35 # wtf to generate 4291 warning due to operator new/delete |
37 # implementations. Disable the warning for chromium windows multi-dll | 36 # implementations. Disable the warning for chromium windows multi-dll |
38 # build. | 37 # build. |
39 cflags += [ "/wd4291" ] | 38 cflags += [ "/wd4291" ] |
40 } | 39 } |
41 } | 40 } |
42 } | 41 } |
43 | 42 |
44 component("wtf") { | 43 component("wtf") { |
45 sources = gypi_values.wtf_files | 44 sources = gypi_values.wtf_files |
46 | 45 |
47 configs += [ | 46 configs += [ |
48 "//third_party/WebKit/Source:config", | 47 "//third_party/WebKit/Source:config", |
49 "//third_party/WebKit/Source:non_test_config", | 48 "//third_party/WebKit/Source:non_test_config", |
50 ] | 49 ] |
51 | 50 |
52 defines = [ "WTF_IMPLEMENTATION=1" ] | 51 defines = [ "WTF_IMPLEMENTATION=1" ] |
53 | 52 |
54 public_configs = [ | 53 public_configs = [ |
55 ":wtf_config", | 54 ":wtf_config", |
| 55 |
56 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 56 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
57 "//build/config/compiler:no_size_t_to_int_warning", | 57 "//build/config/compiler:no_size_t_to_int_warning", |
58 "//third_party/WebKit/Source:features", | 58 "//third_party/WebKit/Source:features", |
59 ] | 59 ] |
60 | 60 |
61 public_deps = [ | 61 public_deps = [ |
62 "//third_party/icu", | 62 "//third_party/icu", |
63 ] | 63 ] |
64 | 64 |
65 if (is_win) { | 65 if (is_win) { |
66 sources -= [ | 66 sources -= [ "ThreadingPthreads.cpp" ] |
67 "ThreadingPthreads.cpp", | |
68 ] | |
69 | 67 |
70 cflags = [ | 68 cflags = [ "/wd4068" ] # Unknown pragma. |
71 "/wd4068", # Unknown pragma. | |
72 ] | |
73 } else { | 69 } else { |
74 # Non-Windows. | 70 # Non-Windows. |
75 sources -= [ | 71 sources -= [ |
76 "ThreadSpecificWin.cpp", | 72 "ThreadSpecificWin.cpp", |
77 "ThreadingWin.cpp", | 73 "ThreadingWin.cpp", |
78 ] | 74 ] |
79 } | 75 } |
80 | 76 |
81 if (is_android) { | 77 if (is_android) { |
82 libs = [ "log" ] | 78 libs = [ "log" ] |
83 } | 79 } |
84 if (is_linux) { | 80 if (is_linux) { |
85 libs = [ "dl" ] | 81 libs = [ "dl" ] |
86 } | 82 } |
87 | 83 |
88 if (is_mac) { | 84 if (is_mac) { |
89 libs = [ "CoreFoundation.framework", "Foundation.framework" ] | 85 libs = [ |
| 86 "CoreFoundation.framework", |
| 87 "Foundation.framework", |
| 88 ] |
90 } else { | 89 } else { |
91 sources -= [ | 90 sources -= [ |
| 91 "text/AtomicStringCF.cpp", |
92 "text/StringImplCF.cpp", | 92 "text/StringImplCF.cpp", |
93 "text/AtomicStringCF.cpp", | |
94 ] | 93 ] |
95 } | 94 } |
96 } | 95 } |
97 | 96 |
98 test("wtf_unittests") { | 97 test("wtf_unittests") { |
99 visibility = [] # Allow re-assignment of list. | 98 visibility = [] # Allow re-assignment of list. |
100 visibility = [ "*" ] | 99 visibility = [ "*" ] |
101 | 100 |
102 sources = gypi_values.wtf_unittest_files | 101 sources = gypi_values.wtf_unittest_files |
103 | 102 |
104 sources += [ "testing/RunAllTests.cpp" ] | 103 sources += [ "testing/RunAllTests.cpp" ] |
105 | 104 |
106 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 105 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
107 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 106 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
108 | 107 |
109 if (is_win) { | 108 if (is_win) { |
110 cflags = [ "/wd4068" ] # Unknown pragma. | 109 cflags = [ "/wd4068" ] # Unknown pragma. |
111 } | 110 } |
112 | 111 |
113 configs += [ "//third_party/WebKit/Source:config", ] | 112 configs += [ "//third_party/WebKit/Source:config" ] |
114 | 113 |
115 deps = [ | 114 deps = [ |
116 ":test_support", | 115 ":test_support", |
117 ":wtf", | 116 ":wtf", |
118 "//base", | 117 "//base", |
119 "//base/allocator", | 118 "//base/allocator", |
120 "//base/test:test_support", | 119 "//base/test:test_support", |
121 "//testing/gmock", | 120 "//testing/gmock", |
122 "//testing/gtest", | 121 "//testing/gtest", |
123 ] | 122 ] |
124 } | 123 } |
125 | 124 |
126 component("test_support") { | 125 component("test_support") { |
127 output_name = "wtf_test_support" | 126 output_name = "wtf_test_support" |
128 sources = gypi_values.wtf_unittest_helper_files | 127 sources = gypi_values.wtf_unittest_helper_files |
129 defines = [ "WTF_UNITTEST_HELPERS_IMPLEMENTATION=1" ] | 128 defines = [ "WTF_UNITTEST_HELPERS_IMPLEMENTATION=1" ] |
130 | 129 |
131 configs += [ | 130 configs += [ |
132 ":wtf_config", | 131 ":wtf_config", |
| 132 |
133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 133 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
134 "//build/config/compiler:no_size_t_to_int_warning", | 134 "//build/config/compiler:no_size_t_to_int_warning", |
135 "//third_party/WebKit/Source:config", | 135 "//third_party/WebKit/Source:config", |
136 "//third_party/WebKit/Source:non_test_config", | 136 "//third_party/WebKit/Source:non_test_config", |
137 ] | 137 ] |
138 | 138 |
139 deps = [ | 139 deps = [ |
140 ":wtf", | 140 ":wtf", |
141 ] | 141 ] |
142 } | 142 } |
OLD | NEW |