Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 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 | |
| 7 # | |
| 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 | |
| 10 # only wtf/ can refer the contents in platform/wtf/. | |
| 11 # | |
| 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" | |
| 14 # target. "platform_wtf" can only be used from "wtf" for the moment to allow | |
| 15 # only redirection headers in wtf/ to include the headers in "platform/wtf". | |
|
haraken
2017/02/17 10:37:24
But it's fine to use platform_wtf from core/, modu
Yuta Kitamura
2017/02/17 11:41:05
Yeah, I think you are right. Both gn-wise and DEPS
| |
| 16 # | |
| 17 # The following configurations are mostly copied from wtf/BUILD.gn, so we | |
| 18 # can build the source files in the same way. | |
| 19 # | |
| 20 # When we finish moving all the files, "platform_wtf" target will take over | |
| 21 # the role of "wtf". | |
| 22 # | |
| 23 # TODO(yutak): Set up platform_wtf_unittests in the similar manner. | |
| 24 | |
| 25 assert(!is_ios) | |
| 26 | |
| 27 import("//third_party/WebKit/Source/config.gni") | |
| 28 | |
| 29 visibility = [ "//third_party/WebKit/Source/wtf/*" ] | |
| 30 | |
| 31 config("wtf_config") { | |
| 32 if (is_win) { | |
| 33 defines = [ | |
| 34 "__STD_C", | |
| 35 "_CRT_SECURE_NO_DEPRECATE", | |
| 36 "_SCL_SECURE_NO_DEPRECATE", | |
| 37 ] | |
| 38 include_dirs = [ "os-win32" ] | |
| 39 | |
| 40 cflags = [ | |
| 41 # Don't complain about calling specific versions of templatized | |
| 42 # functions (e.g. in RefPtrHashMap.h). | |
| 43 "/wd4344", | |
| 44 | |
| 45 # dtoa, icu, etc. like doing assignment within conditional. | |
| 46 "/wd4706", | |
| 47 ] | |
| 48 | |
| 49 if (is_component_build) { | |
| 50 # Chromium windows multi-dll build enables C++ exceptions and this causes | |
| 51 # wtf to generate 4291 warning due to operator new/delete | |
| 52 # implementations. Disable the warning for chromium windows multi-dll | |
| 53 # build. | |
| 54 cflags += [ "/wd4291" ] | |
| 55 } | |
| 56 } | |
| 57 } | |
| 58 | |
| 59 component("platform_wtf") { | |
| 60 sources = [ | |
| 61 "CryptographicallyRandomNumber.cpp", | |
| 62 "CryptographicallyRandomNumber.h", | |
| 63 "WTFExport.h", | |
| 64 ] | |
| 65 | |
| 66 configs += [ | |
| 67 "//third_party/WebKit/Source:config", | |
| 68 "//third_party/WebKit/Source:non_test_config", | |
| 69 "//third_party/WebKit/Source:blink_pch", | |
| 70 ] | |
| 71 | |
| 72 defines = [ "WTF_IMPLEMENTATION=1" ] | |
| 73 | |
| 74 public_configs = [ | |
| 75 ":wtf_config", | |
| 76 | |
| 77 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
| 78 "//build/config/compiler:no_size_t_to_int_warning", | |
| 79 "//third_party/WebKit/Source:features", | |
| 80 ] | |
| 81 | |
| 82 public_deps = [ | |
| 83 "//base", | |
| 84 "//third_party/icu", | |
| 85 ] | |
| 86 | |
| 87 # Rules changing the |sources| list are temporarily commented out, until | |
| 88 # those files are actually moved to here. | |
| 89 | |
| 90 if (is_win) { | |
| 91 # sources -= [ "ThreadingPthreads.cpp" ] | |
| 92 | |
| 93 cflags = [ "/wd4068" ] # Unknown pragma. | |
| 94 } else { | |
| 95 # Non-Windows. | |
| 96 # sources -= [ | |
| 97 # "ThreadSpecificWin.cpp", | |
| 98 # "ThreadingWin.cpp", | |
| 99 # ] | |
| 100 } | |
| 101 | |
| 102 if (is_android) { | |
| 103 libs = [ "log" ] | |
| 104 } | |
| 105 if (is_linux) { | |
| 106 libs = [ "dl" ] | |
| 107 } | |
| 108 | |
| 109 if (is_mac) { | |
| 110 libs = [ | |
| 111 "CoreFoundation.framework", | |
| 112 "Foundation.framework", | |
| 113 ] | |
| 114 } else { | |
| 115 # sources -= [ | |
| 116 # "text/AtomicStringCF.cpp", | |
| 117 # "text/StringImplCF.cpp", | |
| 118 # ] | |
| 119 } | |
| 120 | |
| 121 if (remove_webcore_debug_symbols) { | |
| 122 configs -= [ "//build/config/compiler:default_symbols" ] | |
| 123 configs += [ "//build/config/compiler:no_symbols" ] | |
| 124 } | |
| 125 } | |
| OLD | NEW |