blob: 023849debc931adf116ef505864b0c8936edef58 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# 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")
import("//testing/test.gni")
import("//third_party/WebKit/Source/build/scripts/scripts.gni")
import("//third_party/WebKit/Source/config.gni")
import("//third_party/WebKit/Source/platform/platform.gni")
import("//third_party/WebKit/Source/platform/platform_generated.gni")
# Most targets in this file are private actions so use that as the default.
visibility = [ ":*" ]
heap_gypi = exec_script("//build/gypi_to_gn.py",
[ rebase_path("heap/blink_heap.gypi") ],
"scope",
[ "heap/blink_heap.gypi" ])
blink_platform_neon_files = [ "graphics/cpu/arm/WebGLImageConversionNEON.h" ]
blink_platform_sse_files = [ "graphics/cpu/x86/WebGLImageConversionSSE.h" ]
# blink_common in blink_platform.gyp
component("blink_common") {
visibility = [] # Allow re-assignment of list.
visibility = [ "//third_party/WebKit/*" ]
sources = [
"exported/URLConversion.cpp",
"exported/WebCString.cpp",
"exported/WebCommon.cpp",
"exported/WebString.cpp",
]
defines = [
"BLINK_COMMON_IMPLEMENTATION=1",
"INSIDE_BLINK",
]
configs += [
"//build/config/compiler:wexit_time_destructors",
"//third_party/WebKit/Source:config",
"//third_party/WebKit/Source:non_test_config",
]
deps = [
"//base",
"//third_party/WebKit/Source/wtf",
"//url",
]
}
# FontFamilyNames action in make_platform_generated in
# platform_generated.gyp
action("font_family_names") {
script = "../build/scripts/make_names.py"
font_family_names_in = "fonts/FontFamilyNames.in"
inputs = make_names_files + [ font_family_names_in ]
outputs = [
"$blink_platform_output_dir/FontFamilyNames.cpp",
"$blink_platform_output_dir/FontFamilyNames.h",
]
args = [
rebase_path(font_family_names_in, root_build_dir),
"--output_dir",
rebase_path(blink_platform_output_dir, root_build_dir),
]
}
# HTTPNames action in make_platform_generated in
# platform_generated.gyp
action("http_names") {
script = "../build/scripts/make_names.py"
http_names_in = "network/HTTPNames.in"
inputs = make_names_files + [ http_names_in ]
outputs = [
"$blink_platform_output_dir/HTTPNames.cpp",
"$blink_platform_output_dir/HTTPNames.h",
]
args = [
rebase_path(http_names_in, root_build_dir),
"--output_dir",
rebase_path(blink_platform_output_dir, root_build_dir),
]
}
# RuntimeEnabledFeatures action in make_platform_generated in
# platform_generated.gyp
action("runtime_enabled_features") {
script = "../build/scripts/make_runtime_features.py"
runtime_enabled_features_in = "RuntimeEnabledFeatures.in"
inputs = scripts_for_in_files + [
runtime_enabled_features_in,
"../build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl",
"../build/scripts/templates/RuntimeEnabledFeatures.h.tmpl",
]
outputs = [
"$blink_platform_output_dir/RuntimeEnabledFeatures.cpp",
"$blink_platform_output_dir/RuntimeEnabledFeatures.h",
]
args = [
rebase_path(runtime_enabled_features_in, root_build_dir),
"--output_dir",
rebase_path(blink_platform_output_dir, root_build_dir),
]
}
# ColorData action in make_platform_generated in platform_generated.gyp
action("color_data") {
script = "../build/scripts/gperf.py"
color_data_gperf = "ColorData.gperf"
inputs = [
color_data_gperf,
]
output_file = "$blink_platform_output_dir/ColorData.cpp"
outputs = [
output_file,
]
args = [
gperf_exe,
"--key-positions=*",
"-D",
"-s",
"2",
rebase_path(color_data_gperf, root_build_dir),
"--output-file=" + rebase_path(output_file, root_build_dir),
]
}
# This isn't strictly necessary since we can just add the deps to "platform",
# but it helps to have the targets match the GYP build.
group("make_platform_generated") {
visibility = [] # Allow re-assignment of list.
visibility = [ "//third_party/WebKit/Source/*" ]
public_deps = [
":blink_common",
":color_data",
":font_family_names",
":http_names",
":runtime_enabled_features",
]
}
# TODO(brettw) Objective C Renaming postbuild steps on Mac.
# blink_platform target in blink_platform.gyp
component("platform") {
visibility = [] # Allow re-assignment of list.
visibility = [ "//third_party/WebKit/*" ]
output_name = "blink_platform"
sources = platform_files
sources -= blink_platform_neon_files
sources -= blink_platform_sse_files
# Add in the generated files.
sources += get_target_outputs(":font_family_names") +
get_target_outputs(":http_names") +
get_target_outputs(":runtime_enabled_features") +
get_target_outputs(":color_data")
configs += [
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//third_party/WebKit/Source:config",
"//third_party/WebKit/Source:non_test_config",
]
defines = [
"BLINK_PLATFORM_IMPLEMENTATION=1",
"INSIDE_BLINK",
]
include_dirs = [
#"$angle_path/include",
"$root_gen_dir/blink",
]
public_deps = [
"//base",
"//cc",
"//gpu/command_buffer/client:gles2_c_lib",
"//skia",
"//third_party:jpeg",
"//third_party/WebKit/Source/wtf",
"//third_party/iccjpeg",
"//third_party/libpng",
"//third_party/libwebp",
"//third_party/ots",
"//third_party/qcms",
"//url",
"//v8",
]
deps = [
":make_platform_generated",
"//third_party/WebKit/Source/platform/heap",
"//third_party/harfbuzz-ng",
"//third_party/icu",
"//ui/gfx",
"//ui/gfx/geometry",
]
if (is_mac) {
sources -= [
# Uses KillRingMac.mm instead.
"KillRingNone.cpp",
"fonts/skia/FontCacheSkia.cpp",
"scroll/ScrollAnimator.cpp",
"scroll/ScrollAnimator.h",
# Mac uses only ScrollAnimatorMac.
"scroll/ScrollbarThemeNonMacCommon.cpp",
"scroll/ScrollbarThemeNonMacCommon.h",
# Uses LocaleMac instead.
"text/LocaleICU.cpp",
"text/LocaleICU.h",
]
configs += [ "//third_party/WebKit/Source:mac_precompiled_headers" ]
libs = [
"Accelerate.framework",
"Carbon.framework",
"Foundation.framework",
]
} else {
sources -= [
"geometry/cg/FloatPointCG.cpp",
"geometry/cg/FloatRectCG.cpp",
"geometry/cg/FloatSizeCG.cpp",
"geometry/cg/IntPointCG.cpp",
"geometry/cg/IntRectCG.cpp",
"geometry/cg/IntSizeCG.cpp",
]
}
if (is_win) {
sources -= [
"clipboard/ClipboardUtilitiesPosix.cpp",
# Uses LocaleWin instead.
"text/LocaleICU.cpp",
"text/LocaleICU.h",
]
cflags = [
"/wd4334", # Result of 32-bit shift implicitly converted to 64 bits.
"/wd4724", # Modulo by 0.
]
} else {
sources -= [
"clipboard/ClipboardUtilitiesWin.cpp",
"text/LocaleWin.cpp",
]
}
if (is_android) {
# Add in some Linux files also shared with Android.
set_sources_assignment_filter([])
sources += [
"exported/linux/WebFontRenderStyle.cpp",
"fonts/linux/FontPlatformDataLinux.cpp",
]
set_sources_assignment_filter(sources_assignment_filter)
} else {
sources -= [ "scroll/ScrollbarThemeAndroid.cpp" ]
}
if (is_linux) {
public_deps += [ "//build/linux:fontconfig" ]
}
if (!use_default_render_theme) {
sources -= [
"scroll/ScrollbarThemeAura.cpp",
"scroll/ScrollbarThemeAura.h",
]
}
if (current_cpu == "arm") {
deps += [ ":blink_arm_neon" ]
}
if (current_cpu == "x86" || current_cpu == "x64") {
deps += [ ":blink_x86_sse" ]
}
if (use_webaudio_ffmpeg) {
include_dirs += [ "//third_party/ffmpeg" ]
deps += [ "//third_party/ffmpeg" ]
}
if (use_openmax_dl_fft) {
include_dirs += [ "//third_party/openmax_dl" ]
deps += [ "//third_party/openmax_dl/dl" ]
}
}
source_set("test_support") {
sources = platform_test_support_files
visibility += [ "//third_party/WebKit/*" ]
configs += [
"//third_party/WebKit/Source:config",
"//third_party/WebKit/Source:inside_blink",
"//third_party/WebKit/Source:non_test_config",
]
deps = [
":platform",
]
if (is_win) {
cflags = [ "/wd4267" ] # Truncation from size_t to int.
}
}
# TODO(GYP): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("blink_heap_unittests_run") {
testonly = true
deps = [
":blink_heap_unittests",
]
}
# GYP: blink_heap_unittests
test("blink_heap_unittests") {
visibility = [] # Allow re-assignment of list.
visibility = [ "*" ]
sources = rebase_path(heap_gypi.platform_heap_test_files, ".", "heap")
sources += [ "heap/RunAllTests.cpp" ]
configs += [
"//third_party/WebKit/Source/wtf:wtf_config",
"//third_party/WebKit/Source:config",
]
defines = [ "INSIDE_BLINK" ]
deps = [
":platform",
"//base",
"//base/allocator",
"//base/test:test_support",
"//content/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/WebKit/Source/wtf",
"//third_party/WebKit/Source/wtf:test_support",
]
if (is_android) {
deps += [
"//base:base_java",
"//content/shell/android:content_shell_assets",
"//net/android:net_java",
]
}
}
# TODO(GYP): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("blink_platform_unittests_run") {
testonly = true
deps = [
":blink_platform_unittests",
]
}
test("blink_platform_unittests") {
visibility = [] # Allow re-assignment of list.
visibility = [ "*" ]
sources = platform_test_files
if (is_win) {
sources += [ "text/LocaleWinTest.cpp" ]
} else if (is_mac) {
sources += [ "text/LocaleMacTest.cpp" ]
} else if (is_posix) {
sources += [ "text/LocaleICUTest.cpp" ]
}
if (!is_mac) {
sources += [ "scroll/ScrollAnimatorTest.cpp" ]
}
sources += [ "testing/RunAllTests.cpp" ]
configs += [
"//third_party/WebKit/Source/wtf:wtf_config",
"//third_party/WebKit/Source:config",
]
deps = [
":blink_common",
":platform",
":test_support",
"//base",
"//base/allocator",
"//base/test:test_support",
"//cc",
"//cc:test_support",
"//cc/blink",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//third_party/WebKit/Source/wtf",
"//third_party/WebKit/Source/wtf:test_support",
"//third_party/harfbuzz-ng",
"//ui/gfx",
"//ui/gfx/geometry",
"//url",
]
defines = [ "INSIDE_BLINK" ]
include_dirs = [ "$root_gen_dir/blink" ]
}
if (current_cpu == "arm") {
source_set("blink_arm_neon") {
sources = blink_platform_neon_files
# The *NEON.cpp files fail to compile when -mthumb is passed. Force
# them to build in ARM mode.
# See https://bugs.webkit.org/show_bug.cgi?id=62916.
# TODO(GYP)
#'cflags': ['-marm'],
# 'conditions': [
# ['OS=="android"', {
# 'cflags!': ['-mthumb'],
# }],
# ],
deps = [
":blink_common",
]
}
}
if (current_cpu == "x86" || current_cpu == "x64") {
source_set("blink_x86_sse") {
sources = blink_platform_sse_files
deps = [
":blink_common",
]
}
}