# libchromium **Repository Path**: antler/libchromium ## Basic Information - **Project Name**: libchromium - **Description**: libchromium库精简版,目前支持以下库 1. base 2. mojo - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-03-11 - **Last Updated**: 2024-05-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Checking out and Building Chromium for Windows ### 1. Install Visual Studio - Visual Studio 2017 (>=15.7.2) to build, but VS2019 (>=16.0.0) is preferred. - Install the "Desktop development with C++" component and "MFC/ATL support" sub-components - You must have the version 10.0.19041 or higher Windows 10 SDK installed ### 2. Install depot_tools - Download the [depot_tools](https://storage.googleapis.com/chrome-infra/depot_tools.zip) bundle and use “Extract all…” from the context menu though - Add depot_tools to the start of your PATH - Add DEPOT_TOOLS_WIN_TOOLCHAIN system variable and set it to 0 - From a cmd.exe shell, run the command gclient (without arguments). On first run, gclient will install all the Windows-specific bits needed to work with the code, then you can add DEPOT_TOOLS_UPDATE system variable and set it to 0 for disable update depot_tools ### 3. Get the code Create a demo directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces): ``` $ mkdir demo && cd demo ``` switch to the demo directory and create .gclient file ``` $ gclient config --name="src/solution" --unmanaged https://gitee.com/antler/test_gn_project.git ``` ``` $ gclient sync --no-history -v ``` ### 4. Setting up the build Add CHROMIUM_BUILDTOOLS_PATH system variable and set it to \path\to\src\buildtools ``` $ gn gen out\Debug_x64 --args="import(\"//solution/build/args/debug_x64.gn\")" ``` build //solution ``` $ autoninja -C out\Debug_x64 solution ``` build //gn_all for unittest ``` $ autoninja -C out\Debug_x64 gn_all ``` ## Checking out and Building Chromium for Linux ### 1. Install depot_tools - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - Add depot_tools to the end of your PATH (you will probably want to put this in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools to /path/to/depot_tools: ``` $ export PATH="$PATH:/path/to/depot_tools" ``` ### 2. Get the code Create a demo directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces): ``` $ mkdir demo && cd demo ``` switch to the demo directory and create .gclient file ``` $ gclient config --name="src/solution" --unmanaged https://gitee.com/antler/test_gn_project.git ``` ``` $ gclient sync --no-history -v ``` ### 3. Install additional build dependencies Once you have checked out the code, and assuming you're using Ubuntu, run build/install-build-deps.sh ``` $ ./build/install-build-deps.sh ``` ### 4. Setting up the build Add CHROMIUM_BUILDTOOLS_PATH system variable and set it to path/to/src/buildtools compile target_cpu="arm" ``` python build/linux/sysroot_scripts/install-sysroot.py --arch=arm python build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 sudo apt-get install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf ``` ``` $ gn gen out/Debug_arm --args="import(\"//solution/build/args/debug_arm.gn\")" ``` build //solution ``` $ autoninja -C out/Debug_arm solution ``` build //gn_all for unittest ``` $ autoninja -C out/Debug_arm gn_all ``` ## Checking out and building Chromium for Mac ### 1. Install Xcode - Xcode 12.2+. - xcodebuild -version if xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance $ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/ ### 2. Install depot_tools - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - Add depot_tools to the end of your PATH (you will probably want to put this in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools to /path/to/depot_tools: ``` $ export PATH="$PATH:/path/to/depot_tools" ``` ### 3. Get the code Create a demo directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces): ``` $ mkdir demo && cd demo ``` switch to the demo directory and create .gclient file ``` $ gclient config --name="src/solution" --unmanaged https://gitee.com/antler/test_gn_project.git ``` ``` $ gclient sync --no-history -v ``` ### 4. Setting up the build Add CHROMIUM_BUILDTOOLS_PATH system variable and set it to \path\to\src\buildtools ``` $ gn gen out\Debug_x64 --args="import(\"//solution/build/args/debug_x64.gn\")" ``` build //solution ``` $ autoninja -C out\Debug_x64 solution ``` build //gn_all for unittest ``` $ autoninja -C out\Debug_x64 gn_all ```