Commit 1b002996 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

third_party: Make it possible to build chromium with system wayland

This patch makes it possible to use system wayland libraries when
building Chromium with Wayland support. By default, the wayland
libraries in the //third_party are used.

Change-Id: I34809fe643fb4967b9ac146af17f7845697fd394
Reviewed-on: https://chromium-review.googlesource.com/1033746Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#555674}
parent 7442d6e4
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/linux/pkg_config.gni")
config("wayland_config") { declare_args() {
include_dirs = [ # Controls whether the build should use the version of Wayland
"include/src", # library shipped with the system or Chromium third_party.
"include/protocol", use_system_libwayland = false
"src/src",
]
} }
static_library("wayland_util") { if (!use_system_libwayland) {
sources = [ config("wayland_config") {
"src/src/wayland-util.c", include_dirs = [
"src/src/wayland-util.h", "include/src",
] "include/protocol",
"src/src",
configs -= [ "//build/config/compiler:chromium_code" ] ]
configs += [ "//build/config/compiler:no_chromium_code" ] }
public_configs = [ ":wayland_config" ] static_library("wayland_util") {
} sources = [
"src/src/wayland-util.c",
static_library("wayland_private") { "src/src/wayland-util.h",
sources = [ ]
"src/src/connection.c",
"src/src/wayland-os.c", configs -= [ "//build/config/compiler:chromium_code" ]
"src/src/wayland-os.h", configs += [ "//build/config/compiler:no_chromium_code" ]
"src/src/wayland-private.h",
] public_configs = [ ":wayland_config" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ static_library("wayland_private") {
"//build/config/compiler:no_chromium_code", sources = [
"//build/config/linux/libffi", "src/src/connection.c",
":wayland_config", "src/src/wayland-os.c",
] "src/src/wayland-os.h",
"src/src/wayland-private.h",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//build/config/linux/libffi",
":wayland_config",
]
}
static_library("wayland_protocol") {
sources = [
"protocol/wayland-protocol.c",
]
deps = [
":wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":wayland_config" ]
}
static_library("wayland_server") {
sources = [
"include/protocol/wayland-server-protocol.h",
"src/src/event-loop.c",
"src/src/wayland-server.c",
"src/src/wayland-shm.c",
]
deps = [
":wayland_private",
":wayland_protocol",
":wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//build/config/linux/libffi",
]
public_configs = [ ":wayland_config" ]
}
static_library("wayland_client") {
sources = [
"include/protocol/wayland-client-protocol.h",
"src/src/wayland-client.c",
]
deps = [
":wayland_private",
":wayland_protocol",
":wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//build/config/linux/libffi",
]
public_configs = [ ":wayland_config" ]
}
} }
static_library("wayland_protocol") { if (use_system_libwayland) {
sources = [ pkg_config("wayland_client_config") {
"protocol/wayland-protocol.c", packages = [ "wayland-client" ]
] }
deps = [ pkg_config("wayland_server_config") {
":wayland_util", packages = [ "wayland-server" ]
] }
configs -= [ "//build/config/compiler:chromium_code" ] group("wayland_client") {
configs += [ "//build/config/compiler:no_chromium_code" ] public_configs = [ ":wayland_client_config" ]
}
public_configs = [ ":wayland_config" ] group("wayland_server") {
} public_configs = [ ":wayland_server_config" ]
}
static_library("wayland_server") {
sources = [
"include/protocol/wayland-server-protocol.h",
"src/src/event-loop.c",
"src/src/wayland-server.c",
"src/src/wayland-shm.c",
]
deps = [
":wayland_private",
":wayland_protocol",
":wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//build/config/linux/libffi",
]
public_configs = [ ":wayland_config" ]
}
static_library("wayland_client") { group("wayland_util") {
sources = [ public_configs = [ ":wayland_client_config" ]
"include/protocol/wayland-client-protocol.h", }
"src/src/wayland-client.c",
]
deps = [
":wayland_private",
":wayland_protocol",
":wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//build/config/linux/libffi",
]
public_configs = [ ":wayland_config" ]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment