OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 # The below is a temporary setup during the WTF migration project: | 5 # The below is a temporary setup during the WTF migration project: |
6 # https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYC
AAJ | 6 # https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYC
AAJ |
7 # | 7 # |
8 # We are moving wtf/ files to platform/wtf/ incrementally, thus, conceptually, | 8 # We are moving wtf/ files to platform/wtf/ incrementally, thus, conceptually, |
9 # the "wtf" target in wtf/BUILD.gn is being split into two, in a way that | 9 # the "wtf" target in wtf/BUILD.gn is being split into two, in a way that |
10 # only wtf/ can refer the contents in platform/wtf/. | 10 # only wtf/ can refer the contents in platform/wtf/. |
11 # | 11 # |
12 # To achieve this, we introduce a new target "platform_wtf" here, and configure | 12 # To achieve this, we introduce a new target "platform_wtf" here, and configure |
13 # it so the source files are compiled in the same way as the original "wtf" | 13 # it so the source files are compiled in the same way as the original "wtf" |
14 # target. This gn file should only be used from wtf/BUILD.gn, and this | 14 # target. This gn file should only be used from wtf/BUILD.gn, and this |
15 # restriction is enforced by the visibility rule below (but it's okay to | 15 # restriction is enforced by the visibility rule below (but it's okay to |
16 # #include a header in this directory from core/ or modules/). | 16 # #include a header in this directory from core/ or modules/). |
17 # | 17 # |
18 # The following configurations are mostly copied from wtf/BUILD.gn, so we | 18 # The following configurations are mostly copied from wtf/BUILD.gn, so we |
19 # can build the source files in the same way. | 19 # can build the source files in the same way. |
20 # | 20 # |
21 # When we finish moving all the files, "platform_wtf" target will take over | 21 # When we finish moving all the files, "platform_wtf" target will take over |
22 # the role of "wtf". | 22 # the role of "wtf". |
23 # | |
24 # TODO(yutak): Set up platform_wtf_unittests in the similar manner. | |
25 | 23 |
26 assert(!is_ios) | 24 assert(!is_ios) |
27 | 25 |
| 26 import("//testing/test.gni") |
28 import("//third_party/WebKit/Source/config.gni") | 27 import("//third_party/WebKit/Source/config.gni") |
29 | 28 |
30 visibility = [ "//third_party/WebKit/Source/wtf/*" ] | 29 visibility = [ |
| 30 ":*", |
| 31 "//third_party/WebKit/Source/wtf/*", |
| 32 ] |
31 | 33 |
32 config("wtf_config") { | 34 config("wtf_config") { |
33 if (is_win) { | 35 if (is_win) { |
34 defines = [ | 36 defines = [ |
35 "__STD_C", | 37 "__STD_C", |
36 "_CRT_SECURE_NO_DEPRECATE", | 38 "_CRT_SECURE_NO_DEPRECATE", |
37 "_SCL_SECURE_NO_DEPRECATE", | 39 "_SCL_SECURE_NO_DEPRECATE", |
38 ] | 40 ] |
39 include_dirs = [ "os-win32" ] | 41 include_dirs = [ "os-win32" ] |
40 | 42 |
41 cflags = [ | 43 cflags = [ |
42 # Don't complain about calling specific versions of templatized | 44 # Don't complain about calling specific versions of templatized |
43 # functions (e.g. in RefPtrHashMap.h). | 45 # functions (e.g. in RefPtrHashMap.h). |
44 "/wd4344", | 46 "/wd4344", |
45 | 47 |
46 # dtoa, icu, etc. like doing assignment within conditional. | 48 # dtoa, icu, etc. like doing assignment within conditional. |
47 "/wd4706", | 49 "/wd4706", |
48 ] | 50 ] |
49 | 51 |
50 if (is_component_build) { | 52 if (is_component_build) { |
51 # Chromium windows multi-dll build enables C++ exceptions and this causes | 53 # Chromium windows multi-dll build enables C++ exceptions and this causes |
52 # wtf to generate 4291 warning due to operator new/delete | 54 # wtf to generate 4291 warning due to operator new/delete |
53 # implementations. Disable the warning for chromium windows multi-dll | 55 # implementations. Disable the warning for chromium windows multi-dll |
54 # build. | 56 # build. |
55 cflags += [ "/wd4291" ] | 57 cflags += [ "/wd4291" ] |
56 } | 58 } |
57 } | 59 } |
58 } | 60 } |
59 | 61 |
60 source_set("platform_wtf") { | 62 component("platform_wtf") { |
61 sources = [ | 63 sources = [ |
62 "ASCIICType.cpp", | 64 "ASCIICType.cpp", |
63 "ASCIICType.h", | 65 "ASCIICType.h", |
64 "AddressSanitizer.h", | 66 "AddressSanitizer.h", |
65 "Alignment.h", | 67 "Alignment.h", |
66 "Allocator.h", | 68 "Allocator.h", |
67 "Assertions.cpp", | 69 "Assertions.cpp", |
68 "Assertions.h", | 70 "Assertions.h", |
69 "Atomics.h", | 71 "Atomics.h", |
70 "AutoReset.h", | 72 "AutoReset.h", |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 "text/AtomicStringCF.cpp", | 325 "text/AtomicStringCF.cpp", |
324 "text/StringImplCF.cpp", | 326 "text/StringImplCF.cpp", |
325 ] | 327 ] |
326 } | 328 } |
327 | 329 |
328 if (remove_webcore_debug_symbols) { | 330 if (remove_webcore_debug_symbols) { |
329 configs -= [ "//build/config/compiler:default_symbols" ] | 331 configs -= [ "//build/config/compiler:default_symbols" ] |
330 configs += [ "//build/config/compiler:no_symbols" ] | 332 configs += [ "//build/config/compiler:no_symbols" ] |
331 } | 333 } |
332 } | 334 } |
| 335 |
| 336 test("wtf_unittests") { |
| 337 visibility = [] # Allow re-assignment of list. |
| 338 visibility = [ "*" ] |
| 339 |
| 340 sources = [ |
| 341 "ASCIICTypeTest.cpp", |
| 342 "AssertionsTest.cpp", |
| 343 "DequeTest.cpp", |
| 344 "FunctionalTest.cpp", |
| 345 "HashMapTest.cpp", |
| 346 "HashSetTest.cpp", |
| 347 "ListHashSetTest.cpp", |
| 348 "MathExtrasTest.cpp", |
| 349 "OptionalTest.cpp", |
| 350 "PassRefPtrTest.cpp", |
| 351 "RefPtrTest.cpp", |
| 352 "StringExtrasTest.cpp", |
| 353 "StringHasherTest.cpp", |
| 354 "TimeTest.cpp", |
| 355 "TreeNodeTest.cpp", |
| 356 "TypeTraitsTest.cpp", |
| 357 "VectorTest.cpp", |
| 358 "dtoa_test.cpp", |
| 359 "testing/RunAllTests.cpp", |
| 360 "text/AtomicStringTest.cpp", |
| 361 "text/CStringTest.cpp", |
| 362 "text/IntegerToStringConversionTest.cpp", |
| 363 "text/StringBufferTest.cpp", |
| 364 "text/StringBuilderTest.cpp", |
| 365 "text/StringImplTest.cpp", |
| 366 "text/StringOperatorsTest.cpp", |
| 367 "text/StringToNumberTest.cpp", |
| 368 "text/StringViewTest.cpp", |
| 369 "text/TextCodecICUTest.cpp", |
| 370 "text/TextCodecLatin1Test.cpp", |
| 371 "text/TextCodecReplacementTest.cpp", |
| 372 "text/TextCodecTest.cpp", |
| 373 "text/TextCodecUTF8Test.cpp", |
| 374 "text/TextCodecUserDefinedTest.cpp", |
| 375 "text/TextEncodingTest.cpp", |
| 376 "text/WTFStringTest.cpp", |
| 377 "typed_arrays/ArrayBufferBuilderTest.cpp", |
| 378 ] |
| 379 |
| 380 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 381 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 382 |
| 383 if (is_win) { |
| 384 cflags = [ "/wd4068" ] # Unknown pragma. |
| 385 } |
| 386 |
| 387 configs += [ |
| 388 "//third_party/WebKit/Source:config", |
| 389 "//third_party/WebKit/Source:blink_pch", |
| 390 ] |
| 391 |
| 392 deps = [ |
| 393 ":platform_wtf", |
| 394 "//base", |
| 395 "//base/test:test_support", |
| 396 "//testing/gmock", |
| 397 "//testing/gtest", |
| 398 ] |
| 399 } |
OLD | NEW |