blob: d32c572f75536bee783f3e65122ea834cbacf6f9 [file] [log] [blame]
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_linux)
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/testing/testing.gni")
group("linux") {
deps = [
":flutter_linux_gtk",
":publish_headers_linux",
]
if (build_glfw_shell) {
deps += [
":flutter_linux_glfw",
"//flutter/shell/platform/glfw:publish_headers_glfw",
"//flutter/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
]
}
}
# Temporary workaround for the issue describe in
# https://github.com/flutter/flutter/issues/14509 and
# https://github.com/flutter/flutter/issues/14438
# Remove once the build infrastructure moves to Ubuntu 18.04 or newer, where
# the underlying issue is fixed.
config("disable_fatal_link_warnings") {
visibility = [ ":*" ]
ldflags = [ "-Wl,--no-fatal-warnings" ]
}
if (build_glfw_shell) {
shared_library("flutter_linux_glfw") {
deps = [
"//flutter/shell/platform/glfw:flutter_glfw",
]
configs += [ ":disable_fatal_link_warnings" ]
public_configs = [ "//flutter:config" ]
}
}
_public_headers = [
"public/flutter_linux/fl_basic_message_channel.h",
"public/flutter_linux/fl_binary_codec.h",
"public/flutter_linux/fl_binary_messenger.h",
"public/flutter_linux/fl_dart_project.h",
"public/flutter_linux/fl_engine.h",
"public/flutter_linux/fl_json_message_codec.h",
"public/flutter_linux/fl_json_method_codec.h",
"public/flutter_linux/fl_message_codec.h",
"public/flutter_linux/fl_method_call.h",
"public/flutter_linux/fl_method_channel.h",
"public/flutter_linux/fl_method_codec.h",
"public/flutter_linux/fl_method_response.h",
"public/flutter_linux/fl_standard_message_codec.h",
"public/flutter_linux/fl_standard_method_codec.h",
"public/flutter_linux/fl_string_codec.h",
"public/flutter_linux/fl_value.h",
"public/flutter_linux/fl_view.h",
"public/flutter_linux/flutter_linux.h",
]
config("relative_flutter_linux_headers") {
include_dirs = [ "public" ]
}
source_set("flutter_linux") {
public = _public_headers
sources = [
"fl_basic_message_channel.cc",
"fl_binary_codec.cc",
"fl_binary_messenger.cc",
"fl_dart_project.cc",
"fl_engine.cc",
"fl_json_message_codec.cc",
"fl_json_method_codec.cc",
"fl_message_codec.cc",
"fl_method_call.cc",
"fl_method_channel.cc",
"fl_method_codec.cc",
"fl_method_response.cc",
"fl_renderer.cc",
"fl_renderer_x11.cc",
"fl_standard_message_codec.cc",
"fl_standard_method_codec.cc",
"fl_string_codec.cc",
"fl_value.cc",
"fl_view.cc",
]
configs += [
"//flutter/shell/platform/linux/config:gtk",
"//flutter/shell/platform/linux/config:egl",
"//third_party/khronos:khronos_headers",
]
# Set flag to stop headers being directly included (library users should not do this)
defines = [ "FLUTTER_LINUX_COMPILATION" ]
deps = [
"//flutter/shell/platform/embedder:embedder_with_symbol_prefix",
"//third_party/rapidjson",
]
}
test_fixtures("flutter_linux_fixtures") {
fixtures = []
}
executable("flutter_linux_unittests") {
testonly = true
sources = [
"fl_binary_codec_test.cc",
"fl_dart_project_test.cc",
"fl_json_message_codec_test.cc",
"fl_json_method_codec_test.cc",
"fl_message_codec_test.cc",
"fl_method_codec_test.cc",
"fl_method_response_test.cc",
"fl_standard_message_codec_test.cc",
"fl_standard_method_codec_test.cc",
"fl_string_codec_test.cc",
"fl_value_test.cc",
"testing/fl_test.cc",
]
public_configs = [ "//flutter:config" ]
configs += [ "//flutter/shell/platform/linux/config:gtk" ]
# Set flag to allow public headers to be directly included (library users should not do this)
defines = [ "FLUTTER_LINUX_COMPILATION" ]
deps = [
":flutter_linux",
":flutter_linux_fixtures",
"//flutter/testing",
]
}
shared_library("flutter_linux_gtk") {
deps = [
":flutter_linux",
]
public_configs = [ "//flutter:config" ]
}
copy("publish_headers_linux") {
sources = _public_headers
outputs = [
"$root_out_dir/flutter_linux/{{source_file_part}}",
]
}