提交 c6f67824 编写于 作者: A Adam Barth 提交者: GitHub

Prepare libwtf.a to build on Fuchsia (#2913)

We can't quite build it yet because libwtf.a depends on //third_party/icu,
which we don't have yet, but this patch gets us closer.
上级 36b668ea
......@@ -3,12 +3,6 @@
# found in the LICENSE file.
import("config.gni")
if (is_clang) {
import("//build/config/clang/clang.gni")
}
if (is_posix) {
import("//build/config/gcc/gcc_version.gni")
}
visibility = [ "//flutter/sky/*" ]
......@@ -46,6 +40,8 @@ config("non_test_config") {
}
}
if (!is_fuchsia) {
group("engine") {
deps = [
"//flutter/sky/engine/platform",
......@@ -53,3 +49,5 @@ group("engine") {
"//flutter/sky/engine/web",
]
}
}
......@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ui.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
......
......@@ -263,6 +263,19 @@ source_set("platform") {
"transforms/TranslateTransformOperation.h",
]
deps = [
"//mojo/application",
"//mojo/environment:chromium",
"//mojo/public/c/system",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//mojo/public/cpp/utility",
"//mojo/services/network/interfaces",
"//flutter/skia",
"//flutter/sky/engine/wtf",
"//third_party/harfbuzz-ng",
]
if (!is_mac) {
sources += [
"fonts/opentype/OpenTypeVerticalData.cpp",
......@@ -275,6 +288,7 @@ source_set("platform") {
}
if (is_ios) {
deps += [ "//base" ]
sources += [ "fonts/apple/FontCacheIOS.mm" ]
}
......@@ -294,20 +308,6 @@ source_set("platform") {
include_dirs = [ "$root_build_dir" ]
deps = [
"//base:base",
"//mojo/application",
"//mojo/environment:chromium",
"//mojo/public/c/system",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/system",
"//mojo/public/cpp/utility",
"//mojo/services/network/interfaces",
"//flutter/skia",
"//flutter/sky/engine/wtf",
"//third_party/harfbuzz-ng",
]
forward_dependent_configs_from = [
"//flutter/skia",
]
......@@ -367,7 +367,6 @@ test("platform_unittests") {
"//testing/gmock",
"//testing/gtest",
"//flutter/sky/engine/wtf",
"//flutter/sky/engine/wtf:test_support",
]
# TODO(abarth): This is a lie - this test is not embedded in an environment
......
......@@ -2,9 +2,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//testing/test.gni")
config("clang_warnings") {
if (is_clang) {
cflags = [
"-Wno-for-loop-analysis",
"-Wno-shift-negative-value",
]
}
}
component("wtf") {
source_set("wtf") {
sources = [
"ASCIICType.h",
"AddressSpaceRandomization.cpp",
......@@ -179,32 +186,32 @@ component("wtf") {
]
configs += [
":clang_warnings",
"//flutter/sky/engine:config",
"//flutter/sky/engine:non_test_config",
]
defines = [ "WTF_IMPLEMENTATION=1" ]
direct_dependent_configs = [ "//flutter/sky/engine:features" ]
public_configs = [
"//third_party/icu:icu_config",
"//flutter/sky/engine:features",
]
public_deps = [
"//lib/ftl",
"//third_party/icu",
]
deps = [
"//flutter/glue",
"//third_party/icu",
]
forward_dependent_configs_from = [ "//third_party/icu" ]
if (is_android) {
libs = [ "log" ]
}
}
test("unittests") {
output_name = "sky_wtf_unittests"
executable("unittests") {
output_name = "flutter_wtf_unittests"
sources = [
"CheckedArithmeticTest.cpp",
......@@ -220,8 +227,9 @@ test("unittests") {
"StringExtrasTest.cpp",
"StringHasherTest.cpp",
"TemporaryChangeTest.cpp",
"VectorTest.cpp",
"testing/RunAllTests.cpp",
"testing/WTFTestHelpers.cpp",
"testing/WTFTestHelpers.h",
"testing/WTFTestHelpersTest.cpp",
"text/AtomicStringTest.cpp",
"text/CStringTest.cpp",
......@@ -232,43 +240,27 @@ test("unittests") {
"text/TextCodecReplacementTest.cpp",
"text/TextCodecUTF8Test.cpp",
"text/WTFStringTest.cpp",
"VectorTest.cpp",
]
configs += [ "//flutter/sky/engine:config" ]
deps = [
":test_support",
":wtf",
"//third_party/gtest",
]
# TODO(abarth): This is a lie - this test is not embedded in an environment
# that injects the system thunks, so system calls don't actually work. This
# just tricks the linker into thinking that an implementation of these calls
# will be injected at runtime so the link succeeds.
deps += [
"//mojo/public/cpp/environment:standalone",
"//mojo/public/platform/native:system",
]
}
component("test_support") {
output_name = "wtf_test_support"
sources = [
"testing/WTFTestHelpers.cpp",
"testing/WTFTestHelpers.h",
"testing/WTFUnitTestHelpersExport.h",
]
defines = [ "WTF_UNITTEST_HELPERS_IMPLEMENTATION=1" ]
configs += [
":clang_warnings",
"//flutter/sky/engine:config",
"//flutter/sky/engine:non_test_config",
]
deps = [
":wtf",
"//third_party/gtest",
]
if (!is_fuchsia) {
# TODO(abarth): This is a lie - this test is not embedded in an environment
# that injects the system thunks, so system calls don't actually work. This
# just tricks the linker into thinking that an implementation of these calls
# will be injected at runtime so the link succeeds.
deps += [
"//mojo/public/cpp/environment:standalone",
"//mojo/public/platform/native:system",
]
}
}
......@@ -50,6 +50,10 @@
#define WTF_OS_LINUX 1
#endif
#ifdef __Fuchsia__
#define WTF_OS_FUCHSIA 1
#endif
/* Always OS(POSIX) */
#define WTF_OS_POSIX 1
......
......@@ -1096,7 +1096,7 @@ TEST(PartitionAllocTest, LostFreePagesBug)
TestShutdown();
}
#if !OS(ANDROID) && !OS(IOS)
#if !OS(ANDROID) && !OS(IOS) && !OS(FUCHSIA)
// Make sure that malloc(-1) dies.
// In the past, we had an integer overflow that would alias malloc(-1) to
......
......@@ -28,18 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_WTF_WTFEXPORT_H_
#define SKY_ENGINE_WTF_WTFEXPORT_H_
#if !defined(WTF_IMPLEMENTATION)
#define WTF_IMPLEMENTATION 0
#endif
#if defined(COMPONENT_BUILD)
#define WTF_EXPORT __attribute__((visibility("default")))
#else // defined(COMPONENT_BUILD)
#define WTF_EXPORT
#endif
#endif // SKY_ENGINE_WTF_WTFEXPORT_H_
......@@ -31,15 +31,14 @@
#ifndef SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_
#define SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_
#include <iosfwd> // NOLINT
#include <iosfwd> // NOLINT
#include "flutter/sky/engine/wtf/text/WTFString.h"
#include "wtf/testing/WTFUnitTestHelpersExport.h"
namespace WTF {
// Output stream operator so gTest's macros work with WebCore strings.
WTF_UNITTEST_HELPERS_EXPORT std::ostream& operator<<(std::ostream&, const String&);
std::ostream& operator<<(std::ostream&, const String&);
} // namespace WTF
} // namespace WTF
#endif // SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_WTF_TESTING_WTFUNITTESTHELPERSEXPORT_H_
#define SKY_ENGINE_WTF_TESTING_WTFUNITTESTHELPERSEXPORT_H_
#if !defined(WTF_UNITTEST_HELPERS_IMPLEMENTATION)
#define WTF_UNITTEST_HELPERS_IMPLEMENTATION 0
#endif
#if defined(COMPONENT_BUILD)
#define WTF_UNITTEST_HELPERS_EXPORT __attribute__((visibility("default")))
#else // defined(COMPONENT_BUILD)
#define WTF_UNITTEST_HELPERS_EXPORT
#endif
#endif // SKY_ENGINE_WTF_TESTING_WTFUNITTESTHELPERSEXPORT_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册