-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bazel can be used to build CEF-based applications. CEF support for Bazel is considered experimental. For current development status see chromiumembedded/cef#3757 . For updated build and usage instructions see the README.md.
- Loading branch information
1 parent
987ee7d
commit a7a1ce3
Showing
41 changed files
with
2,271 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 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. | ||
|
||
# Enable Bzlmod for every Bazel command. | ||
common --enable_bzlmod | ||
|
||
# Enable build:{macos,linux,windows}. | ||
build --enable_platform_specific_config | ||
|
||
# | ||
# Common configuration. | ||
# | ||
|
||
# Build with C++17. | ||
build:linux --cxxopt='-std=c++17' | ||
build:macos --cxxopt='-std=c++17' | ||
build:macos --copt='-std=c++17' | ||
build:windows --cxxopt='/std:c++17' | ||
|
||
# | ||
# MacOS configuration. | ||
# | ||
|
||
build:macos --copt='-ObjC++' | ||
|
||
# | ||
# Windows configuration. | ||
# | ||
|
||
# Enable creation of symlinks for runfiles. | ||
build:windows --enable_runfiles | ||
|
||
# Use /MT[d]. | ||
build:windows --features=static_link_msvcrt | ||
|
||
# | ||
# Linux configuration. | ||
# | ||
|
||
# The cfi-icall attribute is not supported by the GNU C++ compiler. | ||
# TODO: Move to toolchain or add `--config=[gcc|llvm]` command-line option. | ||
build:linux --cxxopt=-Wno-attributes | ||
|
||
# Use hardlinks instead of symlinks in sandboxes on Linux. | ||
# This is required for CEF binaries to run, and for copy_filegroups() to work | ||
# as expected on Linux. | ||
build:linux --experimental_use_hermetic_linux_sandbox | ||
build:linux --sandbox_add_mount_pair=/etc | ||
build:linux --sandbox_add_mount_pair=/usr | ||
## symlinks into /usr | ||
build:linux --sandbox_add_mount_pair=/usr/bin:/bin | ||
build:linux --sandbox_add_mount_pair=/usr/lib:/lib | ||
build:linux --sandbox_add_mount_pair=/usr/lib64:/lib64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# 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. | ||
|
||
# Allow access from targets in other packages. | ||
package(default_visibility = [ | ||
"//visibility:public", | ||
]) | ||
|
||
load("@bazel_skylib//lib:selects.bzl", "selects") | ||
|
||
# | ||
# Define supported configurations. | ||
# See https://bazel.build/docs/configurable-attributes | ||
# | ||
# Normal build (ARM64 host): | ||
# % bazel build //examples/minimal [-c dbg] | ||
# | ||
# Cross-compile build (ARM64 host): | ||
# % bazel build //examples/minimal --cpu=darwin_x86_64 [-c dbg] | ||
# | ||
|
||
config_setting( | ||
name = "dbg", | ||
values = {"compilation_mode": "dbg"}, | ||
) | ||
|
||
config_setting( | ||
name = "fastbuild", | ||
values = {"compilation_mode": "fastbuild"}, | ||
) | ||
|
||
config_setting( | ||
name = "opt", | ||
values = {"compilation_mode": "opt"}, | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "windows_32", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:x86_32"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "windows_64", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:x86_64"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "windows_arm64", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:arm64"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "linux_64", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:x86_64"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "linux_arm64", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:arm64"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "linux_arm", | ||
match_all = ["@platforms//os:windows", "@platforms//cpu:armv7"], | ||
) | ||
|
||
config_setting( | ||
name = "darwin_x86_64", | ||
values = { | ||
"cpu": "darwin_x86_64" | ||
} | ||
) | ||
|
||
config_setting( | ||
name = "darwin_arm64", | ||
values = { | ||
"cpu": "darwin_arm64" | ||
} | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "macos_64", | ||
match_all = ["@platforms//os:macos", ":darwin_x86_64"], | ||
) | ||
|
||
selects.config_setting_group( | ||
name = "macos_arm64", | ||
match_all = ["@platforms//os:macos", ":darwin_arm64"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 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. | ||
|
||
module(name = "cef-project") | ||
|
||
# Configure local MacOS toolchain. | ||
# See https://github.com/bazelbuild/apple_support/releases | ||
bazel_dep(name = "apple_support", version = "1.16.0", repo_name = "build_bazel_apple_support") | ||
# See https://github.com/bazelbuild/rules_apple/releases | ||
bazel_dep(name = "rules_apple", version = "3.6.0", repo_name = "build_bazel_rules_apple") | ||
|
||
# Configure local C++ toolchain. | ||
# See https://github.com/bazelbuild/rules_cc/releases | ||
bazel_dep(name = "rules_cc", version = "0.0.9") | ||
|
||
# Add other dependencies here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# 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. | ||
|
||
workspace(name = "cef-project") | ||
|
||
# | ||
# Load the CEF binary distribution. | ||
# | ||
|
||
# Download, extract and load the distribution. | ||
load("//bazel/cef:loader.bzl", "load_cef_repo") | ||
load_cef_repo() | ||
|
||
# To load a locally downloaded/extracted distribution use the following | ||
# lines instead: | ||
# load("//bazel/cef:loader.bzl", "load_local_cef_repo") | ||
# load_local_cef_repo(path = "third_party/cef") | ||
|
||
# | ||
# Windows configuration. | ||
# | ||
|
||
# Configure windows SDK. | ||
load("@cef//bazel/win:setup_sdk.bzl", "setup_sdk") | ||
setup_sdk(name = "winsdk") | ||
|
||
# | ||
# Linux configuration. | ||
# | ||
|
||
# Configure Linux using pkg-config. | ||
load("//bazel:external_local_repository.bzl", "external_local_repository") | ||
external_local_repository( | ||
name="pkg_config", | ||
path="@cef//bazel/linux/pkg_config" | ||
) | ||
load("@pkg_config//:pkg_config.bzl", "pkg_config") | ||
|
||
# Define packages used by @cef//tests/cefclient. | ||
|
||
pkg_config( | ||
name = "gmodule2", | ||
pkg_name = "gmodule-2.0", | ||
) | ||
|
||
pkg_config( | ||
name = "gtk3", | ||
pkg_name = "gtk+-3.0", | ||
) | ||
|
||
pkg_config( | ||
name = "gthread2", | ||
pkg_name = "gthread-2.0", | ||
) | ||
|
||
pkg_config( | ||
name = "gtkprint3", | ||
pkg_name = "gtk+-unix-print-3.0", | ||
) | ||
|
||
pkg_config( | ||
name = "xi", | ||
) | ||
|
||
# Define packages used by @cef//tests/ceftests. | ||
|
||
pkg_config( | ||
name = "glib2", | ||
pkg_name = "glib-2.0", | ||
) | ||
|
Oops, something went wrong.