mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-30 11:04:52 +01:00
a6c00b2ff6
Add support for building the CEF binary distribution using Bazel and the default platform toolchain. Tested to work for Windows x64, MacOS ARM64 and x64 (cross-compile from ARM64), and Linux x64. Windows x86 (cross-compile from x64) is known to be broken, see https://github.com/bazelbuild/bazel/issues/22164. Includes minor changes to tests directory structure to meet Bazel build requirements.
129 lines
2.5 KiB
Plaintext
129 lines
2.5 KiB
Plaintext
# Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
|
# reserved. Use of this source code is governed by a BSD-style license that
|
|
# can be found in the LICENSE file.
|
|
|
|
PRODUCT_NAME = "cefclient"
|
|
PKG_NAME = "//tests/{}".format(PRODUCT_NAME)
|
|
|
|
# Allow access from subpackages only.
|
|
package(default_visibility = [
|
|
":__subpackages__",
|
|
])
|
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library")
|
|
|
|
#
|
|
# Source file lists.
|
|
#
|
|
|
|
srcs_common = [
|
|
${cefclient_sources_common}
|
|
]
|
|
|
|
srcs_renderer = [
|
|
${cefclient_sources_renderer}
|
|
]
|
|
|
|
srcs_browser = [
|
|
${cefclient_sources_browser}
|
|
]
|
|
|
|
srcs_browser_linux = [
|
|
${cefclient_sources_linux}
|
|
]
|
|
|
|
srcs_browser_mac = [
|
|
${cefclient_sources_mac}
|
|
]
|
|
|
|
srcs_browser_win = [
|
|
${cefclient_sources_win}
|
|
]
|
|
|
|
srcs_resources = [
|
|
${cefclient_sources_resources}
|
|
]
|
|
|
|
filegroup(
|
|
name = "Resources",
|
|
srcs = srcs_resources,
|
|
)
|
|
|
|
#
|
|
# MacOS targets.
|
|
#
|
|
|
|
objc_library(
|
|
name = "BrowserLibMac",
|
|
srcs = srcs_common + srcs_browser + srcs_browser_mac,
|
|
target_compatible_with = [
|
|
"@platforms//os:macos",
|
|
],
|
|
deps = [
|
|
"//:cef_wrapper",
|
|
"//tests/shared:BrowserLibMac",
|
|
],
|
|
)
|
|
|
|
objc_library(
|
|
name = "RendererLibMac",
|
|
srcs = srcs_common + srcs_renderer,
|
|
target_compatible_with = [
|
|
"@platforms//os:macos",
|
|
],
|
|
deps = [
|
|
"//:cef_wrapper",
|
|
"//tests/shared:RendererLibMac",
|
|
],
|
|
)
|
|
|
|
#
|
|
# Windows targets.
|
|
#
|
|
|
|
# Allow access from the declare_exe target.
|
|
filegroup(
|
|
name = "ResourceH",
|
|
srcs = [
|
|
"browser/resource.h"
|
|
]
|
|
)
|
|
|
|
# Include files directly in the declare_exe target. This simplifies the build
|
|
# configuration and avoids issues with Windows discarding symbols (like WinMain)
|
|
# when linking libraries.
|
|
filegroup(
|
|
name = "SrcsWin",
|
|
srcs = srcs_common + srcs_browser + srcs_browser_win + srcs_renderer,
|
|
target_compatible_with = [
|
|
"@platforms//os:windows",
|
|
],
|
|
)
|
|
|
|
#
|
|
# Linux targets.
|
|
#
|
|
|
|
# Include files directly in the declare_exe target. This simplifies the build
|
|
# configuration.
|
|
filegroup(
|
|
name = "SrcsLinux",
|
|
srcs = srcs_common + srcs_browser + srcs_browser_linux + srcs_renderer,
|
|
target_compatible_with = [
|
|
"@platforms//os:linux",
|
|
],
|
|
)
|
|
|
|
#
|
|
# Alias to platform-specific build targets.
|
|
#
|
|
|
|
alias(
|
|
name = PRODUCT_NAME,
|
|
actual = select({
|
|
"@platforms//os:linux": "{}/linux:{}".format(PKG_NAME, PRODUCT_NAME),
|
|
"@platforms//os:macos": "{}/mac:{}".format(PKG_NAME, PRODUCT_NAME),
|
|
"@platforms//os:windows": "{}/win:{}".format(PKG_NAME, PRODUCT_NAME),
|
|
}),
|
|
)
|