blob: 8c37fb8f62e3f84f1ca95d10bcac966a019b2bea [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. 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.
import("JavaScriptCore.gni")
import("JavaScriptCoreDerivedSources.gni")
import("JavaScriptCore_inspectorDerivedSources.gni")
import("MiniBrowser.gni")
import("WebCore.gni")
import("WebCoreDerivedSources.gni")
import("WebKit.gni")
import("wtf.gni")
config("webkit_config") {
include_dirs = [ "Source/WebKit/fuchsia" ]
}
shared_library("webkit") {
deps = [
":WebKit_source_set",
]
public_configs = [ ":webkit_config" ]
}
config("features") {
# Target configuration - what OS we are building for, what libraries we use.
defines = [
"OS_FUCHSIA=1",
"USE_CAIRO=1",
"USE_CURL=1",
"USE_HARFBUZZ=1",
"BUILDING_WITH_CMAKE", # A lie, but we are using cmakeconfig.h
]
# Features of our build.
defines += [
"HAVE_ACCESSIBILITY=1",
"HAVE_CONFIG_H=1",
"HAVE_FEATURES_H=1",
#"NDEBUG",
]
# Where we put cmakeconfig.h
include_dirs = [ "Source/config" ]
}
config("flags") {
cflags = [
"-fno-sanitize=safe-stack",
# TODO(phosek): This is consistent with how we were building WebKit before
# the default flags changed. However, it is likely that using
# stack-protector-strong is just fine. We should drop -fno-stack-protector
# here after it's been thoroughly tested.
"-fno-stack-protector",
"-Wall",
"-Wcast-align",
"-Wextra",
"-Wformat-security",
"-Wmissing-format-attribute",
"-Wno-deprecated-register",
"-Wno-expansion-to-defined",
"-Wno-format",
"-Wno-max-unsigned-zero",
"-Wno-null-pointer-arithmetic",
"-Wno-parentheses-equality",
"-Wno-pessimizing-move",
"-Wno-tautological-compare",
"-Wno-unused-function",
"-Wno-unused-label",
"-Wno-unused-lambda-capture",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
"-Wno-unused-variable",
"-Wpointer-arith",
"-Wundef",
"-Wwrite-strings",
]
cflags_cc = [ "-std=c++14" ]
}
source_set("WebKit_source_set") {
sources = WebKit_sources
deps = [
":JavaScriptCore",
":WebCore",
":wtf",
"//zircon/public/lib/hid",
]
configs += [
":features",
":flags",
]
configs -= [ "//build/config:symbol_visibility_hidden" ]
defines = [ "BUILDING_WebKit" ]
include_dirs = [
".",
"DerivedSources",
"DerivedSources/ForwardingHeaders",
"DerivedSources/ForwardingHeaders/JavaScriptCore",
"DerivedSources/ForwardingHeaders/WebCore",
"DerivedSources/ForwardingHeaders/WebKitLegacy",
"DerivedSources/JavaScriptCore",
"DerivedSources/WebCore",
"DerivedSources/WebKitLegacy",
"Source",
"Source/WebKit/Storage",
"Source/WebKit/WebCoreSupport",
"Source/WebKit/fuchsia",
"Source/WebKit/fuchsia/WebCoreSupport",
]
cflags = [ "-includeWebKitPrefix.h" ]
}
config("WebCore_config") {
include_dirs = [
".",
"DerivedSources",
"DerivedSources/WebCore",
"Source/ThirdParty/ANGLE",
"Source/ThirdParty/ANGLE/include/KHR",
"Source/WebCore/Modules/airplay",
"Source/WebCore/Modules/applepay",
"Source/WebCore/Modules/battery",
"Source/WebCore/Modules/encryptedmedia",
"Source/WebCore/Modules/fetch",
"Source/WebCore/Modules/geolocation",
"Source/WebCore/Modules/indexeddb",
"Source/WebCore/Modules/indexeddb/client",
"Source/WebCore/Modules/indexeddb/server",
"Source/WebCore/Modules/indexeddb/shared",
"Source/WebCore/Modules/indieui",
"Source/WebCore/Modules/mediacontrols",
"Source/WebCore/Modules/mediasession",
"Source/WebCore/Modules/mediasource",
"Source/WebCore/Modules/mediastream",
"Source/WebCore/Modules/navigatorcontentutils",
"Source/WebCore/Modules/notifications",
"Source/WebCore/Modules/plugins",
"Source/WebCore/Modules/proximity",
"Source/WebCore/Modules/quota",
"Source/WebCore/Modules/speech",
"Source/WebCore/Modules/streams",
"Source/WebCore/Modules/vibration",
"Source/WebCore/Modules/webaudio",
"Source/WebCore/Modules/webdatabase",
"Source/WebCore/Modules/websockets",
"Source/WebCore/accessibility",
"Source/WebCore/animation",
"Source/WebCore/bindings",
"Source/WebCore/bindings/generic",
"Source/WebCore/bindings/js",
"Source/WebCore/bridge",
"Source/WebCore/bridge/c",
"Source/WebCore/bridge/jsc",
"Source/WebCore/contentextensions",
"Source/WebCore/crypto",
"Source/WebCore/crypto/algorithms",
"Source/WebCore/crypto/keys",
"Source/WebCore/crypto/parameters",
"Source/WebCore/css",
"Source/WebCore/css/parser",
"Source/WebCore/cssjit",
"Source/WebCore/dom",
"Source/WebCore/dom/default",
"Source/WebCore/editing",
"Source/WebCore/fileapi",
"Source/WebCore/history",
"Source/WebCore/html",
"Source/WebCore/html/canvas",
"Source/WebCore/html/forms",
"Source/WebCore/html/parser",
"Source/WebCore/html/shadow",
"Source/WebCore/html/track",
"Source/WebCore/inspector",
"Source/WebCore/loader",
"Source/WebCore/loader/appcache",
"Source/WebCore/loader/archive",
"Source/WebCore/loader/archive/mhtml",
"Source/WebCore/loader/cache",
"Source/WebCore/loader/icon",
"Source/WebCore/mathml",
"Source/WebCore/page",
"Source/WebCore/page/animation",
"Source/WebCore/page/csp",
"Source/WebCore/page/scrolling",
"Source/WebCore/platform",
"Source/WebCore/platform/animation",
"Source/WebCore/platform/audio",
"Source/WebCore/platform/cairo",
"Source/WebCore/platform/crypto",
"Source/WebCore/platform/gamepad",
"Source/WebCore/platform/gamepad/deprecated",
"Source/WebCore/platform/gamepad/linux",
"Source/WebCore/platform/graphics",
"Source/WebCore/platform/graphics/cairo",
"Source/WebCore/platform/graphics/cpu/arm",
"Source/WebCore/platform/graphics/cpu/arm/filters",
"Source/WebCore/platform/graphics/displaylists",
"Source/WebCore/platform/graphics/filters",
"Source/WebCore/platform/graphics/freetype",
"Source/WebCore/platform/graphics/harfbuzz",
"Source/WebCore/platform/graphics/harfbuzz/ng",
"Source/WebCore/platform/graphics/opengl",
"Source/WebCore/platform/graphics/opentype",
"Source/WebCore/platform/graphics/transforms",
"Source/WebCore/platform/image-decoders",
"Source/WebCore/platform/image-decoders/bmp",
"Source/WebCore/platform/image-decoders/gif",
"Source/WebCore/platform/image-decoders/ico",
"Source/WebCore/platform/image-decoders/jpeg",
"Source/WebCore/platform/image-decoders/png",
"Source/WebCore/platform/image-decoders/webp",
"Source/WebCore/platform/mediastream",
"Source/WebCore/platform/mock",
"Source/WebCore/platform/mock/mediasource",
"Source/WebCore/platform/network",
"Source/WebCore/platform/network/curl",
"Source/WebCore/platform/sql",
"Source/WebCore/platform/text",
"Source/WebCore/platform/text/icu",
"Source/WebCore/plugins",
"Source/WebCore/rendering",
"Source/WebCore/rendering/line",
"Source/WebCore/rendering/mathml",
"Source/WebCore/rendering/shapes",
"Source/WebCore/rendering/style",
"Source/WebCore/rendering/svg",
"Source/WebCore/replay",
"Source/WebCore/storage",
"Source/WebCore/style",
"Source/WebCore/svg",
"Source/WebCore/svg/animation",
"Source/WebCore/svg/graphics",
"Source/WebCore/svg/graphics/filters",
"Source/WebCore/svg/properties",
"Source/WebCore/testing",
"Source/WebCore/websockets",
"Source/WebCore/workers",
"Source/WebCore/xml",
"Source/WebCore/xml/parser",
"Source/WebCore",
]
defines = []
}
source_set("WebCore") {
sources = WebCore_sources + WebCoreDerivedSources_sources
public_deps = [
":JavaScriptCore",
":wtf",
"//third_party/boringssl",
"//third_party/cairo",
"//third_party/curl:libcurl",
"//third_party/freetype2",
"//third_party/harfbuzz",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/libjpeg-turbo:libjpeg",
"//third_party/libpng",
"//third_party/libxml2",
"//third_party/sqlite",
"//third_party/zlib",
]
public_configs = [ ":WebCore_config" ]
configs += [
":features",
":flags",
]
}
config("JavaScriptCore_config") {
include_dirs = [
"Source/JavaScriptCore",
"Source/JavaScriptCore/..",
"Source/JavaScriptCore/API",
"Source/JavaScriptCore/ForwardingHeaders",
"Source/JavaScriptCore/assembler",
"Source/JavaScriptCore/b3",
"Source/JavaScriptCore/b3/air",
"Source/JavaScriptCore/bindings",
"Source/JavaScriptCore/builtins",
"Source/JavaScriptCore/bytecode",
"Source/JavaScriptCore/bytecompiler",
"Source/JavaScriptCore/dfg",
"Source/JavaScriptCore/disassembler",
"Source/JavaScriptCore/disassembler/udis86",
"Source/JavaScriptCore/ftl",
"Source/JavaScriptCore/heap",
"Source/JavaScriptCore/debugger",
"Source/JavaScriptCore/inspector",
"Source/JavaScriptCore/inspector/agents",
"Source/JavaScriptCore/inspector/augmentable",
"Source/JavaScriptCore/inspector/remote",
"Source/JavaScriptCore/interpreter",
"Source/JavaScriptCore/jit",
"Source/JavaScriptCore/llint",
"Source/JavaScriptCore/parser",
"Source/JavaScriptCore/profiler",
"Source/JavaScriptCore/replay",
"Source/JavaScriptCore/runtime",
"Source/JavaScriptCore/tools",
"Source/JavaScriptCore/wasm",
"Source/JavaScriptCore/yarr",
"DerivedSources/JavaScriptCore",
"DerivedSources/JavaScriptCore/inspector",
"DerivedSources/ForwardingHeaders",
]
if (is_debug) {
include_dirs += [ "DerivedSources/JavaScriptCore/Debug" ]
} else {
include_dirs += [ "DerivedSources/JavaScriptCore/Release" ]
}
}
source_set("JavaScriptCore") {
sources = JavaScriptCore_sources + JavaScriptCoreDerivedSources_sources +
JavaScriptCore_inspectorDerivedSources_sources
public_configs = [ ":JavaScriptCore_config" ]
configs += [
":features",
":flags",
]
public_deps = [
":wtf",
]
defines = [
"BUILDING_JavaScriptCore",
"STATICALLY_LINKED_WITH_WTF",
]
}
config("wtf_config") {
include_dirs = [ "Source/WTF" ]
}
config("wtf_private_config") {
# WTF has Source/WTF/wtf/unicode/UTF8.h and Source/WTF/wtf on the include
# path. The ICU library, which WTF depends on, has <unicode/utf8.h> in its
# include path. This means on case-insensitive filesystems, #includes for
# <unicode/utf8.h> will match Soruce/WTF/wtf/unicode/UTF8.h, which will
# internally include ICU's <unicode/utf8.h>.
# To get around all this, we manually add ICU's include path to our
# include_dirs before adding the WTF headers so includes for
# <unicode/utf8.h> match ICU regardless of the case sensitivity of the
# filesystem. As it turns out, all of the includes of UTF8.h (uppercase) are
# written <wtf/unicode/UTF8.h> so they will unambiguously resolve to
# Source/WTF/wtf/unicode/UTF8.h even with this include path first.
include_dirs = [ "//third_party/icu/source/common" ]
include_dirs += [
"Source/WTF/wtf",
"Source/WTF/wtf/dtoa",
"Source/WTF/wtf/text",
"Source/WTF/wtf/text/icu",
"Source/WTF/wtf/threads",
"Source/WTF/wtf/unicode",
]
}
source_set("wtf") {
sources = wtf_sources
public_configs = [ ":wtf_config" ]
public_deps = [
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
]
configs += [
":features",
":flags",
":wtf_private_config",
]
defines = [ "BUILDING_WTF" ]
}