Skip to content

Commit 3469ba1

Browse files
authored
Update README.md
1 parent bf16894 commit 3469ba1

File tree

1 file changed

+99
-84
lines changed

1 file changed

+99
-84
lines changed

README.md

Lines changed: 99 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,99 @@
1-
The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromium-based browsers in other applications.
2-
3-
# Quick Links
4-
5-
* Project Page - https://bitbucket.org/chromiumembedded/cef
6-
* Tutorial - https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial
7-
* General Usage - https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage
8-
* Master Build Quick-Start - https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
9-
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
10-
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
11-
* Support Forum - http://www.magpcss.org/ceforum/
12-
* Issue Tracker - https://github.com/chromiumembedded/cef/issues
13-
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
14-
* Downloads - https://cef-builds.spotifycdn.com/index.html
15-
* Donations - http://www.magpcss.org/ceforum/donate.php
16-
17-
# Introduction
18-
19-
CEF is a BSD-licensed open source project founded by Marshall Greenblatt in 2008 and based on the [Google Chromium](http://www.chromium.org/Home) project. Unlike the Chromium project itself, which focuses mainly on Google Chrome application development, CEF focuses on facilitating embedded browser use cases in third-party applications. CEF insulates the user from the underlying Chromium and Blink code complexity by offering production-quality stable APIs, release branches tracking specific Chromium releases, and binary distributions. Most features in CEF have default implementations that provide rich functionality while requiring little or no integration work from the user. There are currently over 100 million installed instances of CEF around the world embedded in products from a wide range of companies and industries. A partial list of companies and products using CEF is available on the [CEF Wikipedia page](http://en.wikipedia.org/wiki/Chromium_Embedded_Framework#Applications_using_CEF). Some use cases for CEF include:
20-
21-
* Embedding an HTML5-compliant Web browser control in an existing native application.
22-
* Creating a light-weight native “shell” application that hosts a user interface developed primarily using Web technologies.
23-
* Rendering Web content “off-screen” in applications that have their own custom drawing frameworks.
24-
* Acting as a host for automated testing of existing Web properties and applications.
25-
26-
CEF supports a wide range of programming languages and operating systems and can be easily integrated into both new and existing applications. It was designed from the ground up with both performance and ease of use in mind. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and Blink implementation details. It provides close integration between the browser and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser.
27-
28-
Numerous individuals and organizations contribute time and resources to support CEF development, but more involvement from the community is always welcome. This includes support for both the core CEF project and external projects that integrate CEF with additional programming languages and frameworks (see the "External Projects" section below). If you are interested in donating time to help with CEF development please see the "Helping Out" section below. If you are interested in donating money to support general CEF development and infrastructure efforts please visit the [CEF Donations](http://www.magpcss.org/ceforum/donate.php) page.
29-
30-
# Getting Started
31-
32-
Users new to CEF development should start by reading the [Tutorial](https://bitbucket.org/chromiumembedded/cef/wiki/Tutorial) Wiki page for an overview of CEF usage and then proceed to the [GeneralUsage](https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage) Wiki page for a more in-depth discussion or architectural and usage issues. Complete API documentation is available [here](https://cef-builds.spotifycdn.com/docs/stable.html). CEF support and related discussion is available on the [CEF Forum](http://www.magpcss.org/ceforum/).
33-
34-
# Binary Distributions
35-
36-
Binary distributions, which include all files necessary to build a CEF-based application, are available on the [Downloads](https://cef-builds.spotifycdn.com/index.html) page. Binary distributions are stand-alone and do not require the download of CEF or Chromium source code. Symbol files for debugging binary distributions of libcef can also be downloaded from the above links.
37-
38-
# Source Distributions
39-
40-
The CEF project is an extension of the Chromium project. CEF maintains development and release branches that track Chromium branches. CEF source code can be downloaded, built and packaged manually or with automated tools. Visit the [BranchesAndBuilding](https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding) Wiki page for more information.
41-
42-
# External Projects
43-
44-
The base CEF framework includes support for the C and C++ programming languages. Thanks to the hard work of external maintainers CEF can integrate with a number of other programming languages and frameworks. These external projects are not maintained by CEF so please contact the respective project maintainer if you have any questions or issues.
45-
46-
* .Net (CEF3) - https://github.com/cefsharp/CefSharp
47-
* .Net (CEF1) - https://bitbucket.org/fddima/cefglue
48-
* .Net/Mono (CEF3) - https://gitlab.com/xiliumhq/chromiumembedded/cefglue
49-
* Delphi - https://github.com/hgourvest/dcef3
50-
* Delphi - https://github.com/salvadordf/CEF4Delphi
51-
* Go - https://github.com/CzarekTomczak/cef2go
52-
* Go - https://github.com/energye/energy
53-
* Java - https://bitbucket.org/chromiumembedded/java-cef
54-
* Python - http://code.google.com/p/cefpython/
55-
56-
If you're the maintainer of a project not listed above and would like your project listed here please either post to the [CEF Forum](http://www.magpcss.org/ceforum/) or contact Marshall directly.
57-
58-
# Helping Out
59-
60-
CEF is still very much a work in progress. Some ways that you can help out:
61-
62-
\- Vote for issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) that are important to you. This helps with development prioritization.
63-
64-
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
65-
66-
* Include the CEF revision or binary distribution version.
67-
* Include information about your OS and compiler version.
68-
* If the issue is a bug please provide detailed reproduction information.
69-
* If the issue is a feature please describe why the feature is beneficial.
70-
71-
\- Write unit tests for new or existing functionality.
72-
73-
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) or search for TODO(cef) in the source code for ideas.
74-
75-
If you would like to contribute source code changes to CEF please follow the below guidelines:
76-
77-
\- Create or find an appropriate issue for each distinct bug, feature or change.
78-
79-
\- Submit a [pull request](https://bitbucket.org/chromiumembedded/cef/wiki/ContributingWithGit) or create a patch with your changes and attach it to the CEF issue. Changes should:
80-
81-
* Be submitted against the current [CEF master branch](https://bitbucket.org/chromiumembedded/cef/src/?at=master) unless explicitly fixing a bug in a CEF release branch.
82-
* Follow the style of existing CEF source files. In general CEF uses the [Chromium C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md).
83-
* Include new or modified unit tests as appropriate to the functionality.
84-
* Not include unnecessary or unrelated changes.
1+
# cef for loongarch64(交叉编译)
2+
3+
* cef社区项目地址 - https://bitbucket.org/chromiumembedded/cef
4+
5+
# 当前分支
6+
* **6723**
7+
-------
8+
# cef 源码编译(交叉编译)
9+
* **编译系统:debian 12**
10+
* **编译平台:x86_64**
11+
* **目标平台:loongarch64**
12+
13+
## 1.制作cef所需交叉编译工具链
14+
* **编译器:[llvm-project](https://github.com/llvm/llvm-project.git)**
15+
* **sysroot:[loongson](https://github.com/loongson)仓库的[build-tools](https://github.com/loongson/build-tools)中的CLFS(clfs-loongarch64-system-x.x-sysroot.squashfs)**
16+
------
17+
### 1.1.制作sysroot
18+
```
19+
mkdir -p /opt/loongarch64/sysroot
20+
mount clfs-loongarch64-system-x.x-sysroot.squashfs /mnt
21+
cp -raf /mnt /opt/loongarch64/sysroot/
22+
umount /mnt
23+
```
24+
* **sysroot保留以下目录结构:**
25+
```
26+
.
27+
|-- lib -> usr/lib
28+
|-- lib64 -> usr/lib64
29+
`-- usr
30+
|-- include
31+
|-- lib
32+
|-- lib64
33+
`-- share
34+
|
35+
`-- pkgconfig
36+
```
37+
### 1.2.编译llvm-project (clang version 19.1.3git (https://github.com/llvm/llvm-project.git ab51eccf88f5321e7c60591c5546b254b6afab99))
38+
```
39+
git clone https://github.com/llvm/llvm-project.git
40+
cd llvm-project
41+
git checkout ab51eccf88f5321e7c60591c5546b254b6afab99
42+
此版本需要打上一个修复补丁(https://github.com/llvm/llvm-project/commit/6377ae46a83e52fe1850a42ce8e1ee3e840243ba)
43+
cmake -S llvm -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_INSTALL_PREFIX=/opt/loongarch64/llvm-19
44+
cd build
45+
ninja && ninja install
46+
```
47+
* **继续在llvm-project目录下编译compiler-rt:**
48+
```
49+
mkdir build-compiler-rt
50+
cd build-compiler-rt
51+
cmake ../compiler-rt/ -G Ninja -DCMAKE_AR=/opt/loongarch64/llvm-19/bin/llvm-ar -DCMAKE_ASM_COMPILER_TARGET=loongarch64-unknown-linux-gnu -DCMAKE_ASM_FLAGS="-mcmodel=medium -mabi=lp64d --target=loongarch64-linux-gnu --sysroot=/opt/loongarch64/sysroot" -DCMAKE_C_COMPILER=/opt/loongarch64/llvm-19/bin/clang -DCMAKE_C_COMPILER_TARGET=loongarch64-unknown-linux-gnu -DCMAKE_C_FLAGS="-mcmodel=medium -mabi=lp64d --target=loongarch64-linux-gnu --sysroot=/opt/loongarch64/sysroot" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DCMAKE_NM=/opt/loongarch64/llvm-19/bin/llvm-nm -DCMAKE_RANLIB=/opt/loongarch64/llvm-19/bin/llvm-ranlib -DCOMPILER_RT_BUILD_BUILTINS=ON -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_PROFILE=ON -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_CMAKE_DIR=/opt/loongarch64/llvm-19 -DCMAKE_INSTALL_PREFIX=/opt/loongarch64/llvm-19/lib/clang/19
52+
rm ./* -rf
53+
```
54+
* **编译x64的compiler-rt:**
55+
```
56+
cmake ../compiler-rt/ -G Ninja -DCMAKE_AR=/opt/loongarch64/llvm-19/bin/llvm-ar -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_FLAGS="" -DCMAKE_C_COMPILER=/opt/loongarch64/llvm-19/bin/clang -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_C_FLAGS="" -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DCMAKE_NM=/opt/loongarch64/llvm-19/bin/llvm-nm -DCMAKE_RANLIB=/opt/loongarch64/llvm-19/bin/llvm-ranlib -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCOMPILER_RT_BUILD_BUILTINS=ON -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_PROFILE=ON -DCOMPILER_RT_BUILD_SANITIZERS=ON -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_CMAKE_DIR=/opt/loongarch64/llvm-19 -DCMAKE_INSTALL_PREFIX=/opt/loongarch64/llvm-19/lib/clang/19
57+
ninja && ninja install
58+
```
59+
## 2.代码拉取
60+
* **代码目录结构:**
61+
```
62+
.
63+
└── code
64+
├── automate
65+
├── cef
66+
├── chromium
67+
└── depot_tools
68+
```
69+
* 在automate目录中下载代码拉取脚本[automate-git.py](https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py)
70+
```
71+
automate/
72+
└── automate-git.py
73+
```
74+
* 获取源码及依赖(在automate目录下执行)
75+
```
76+
python automate-git.py --url=https://github.com/loongson/cef.git --download-dir=/path/to/code --depot-tools-dir=/path/to/code/depot_tools --branch=6723 --no-build --no-distrib
77+
```
78+
## 3.编译cef
79+
### 3.1.将depot_tools加入环境变量
80+
```
81+
export PATH=$PATH:/path/to/code/depot_tools
82+
```
83+
### 3.2.生成编译工程文件
84+
```
85+
cd /path/to/code/chromium/src/cef
86+
GN_DEFINES='target_cpu="loong64" clang_use_chrome_plugins=false treat_warnings_as_errors=false dcheck_always_on=false use_gold=false use_system_libffi=true clang_version=19 clang_base_path="/opt/loongarch64/llvm-19" target_sysroot="/opt/loongarch64/sysroot"' ./cef_create_projects.sh
87+
```
88+
* 也可以将CLFS解压到/path/to/code/chromium/src/build/linux/debian_bullseye_loong64-sysroot下,无需在GN_DEFINES中设置target_sysroot.
89+
### 3.3.执行编译
90+
```
91+
cd /path/to/code/chromium/src
92+
ninja -C out/Release cef chrome_sandbox
93+
ninja -C out/Debug cef chrome_sandbox
94+
```
95+
### 3.4.cef打包
96+
```
97+
cd /path/to/code/chromium/cef
98+
python tools/make_distrib.py --ninja-build --loong64-build --output-dir /path/to/
99+
```

0 commit comments

Comments
 (0)