give me step by step instructions how to make a minimalistic chromium build for mac and linux
Automated Method
CEF provides tools for automatically downloading, building and packaging Chromium and CEF source code. These tools are the recommended way of building CEF locally and can also be integrated with automated build systems as described on the AutomatedBuildSetup Wiki page. See the MasterBuildQuickStart Wiki page for an example of the recommended workflow for local development builds.
These steps apply to the Git workflow only. The Git workflow is recommended for all users and supports CEF3 master and newer CEF3 release branches (1750+).
Download the automate-git.py script. Use the most recent master version of this script even when building release branches.
On Linux: Chromium requires that certain packages be installed. You can install them by running the install-build-deps.sh script or by explicitly running the necessary installation commands.
Run the automate-git.py script at whatever interval is appropriate (for each CEF commit, once per day, once per week, etc).
To build master:
python /path/to/automate/automate-git.py --download-dir=/path/to/download
To build a release branch:
python /path/to/automate/automate-git.py --download-dir=/path/to/download --branch=2785
By default the script will download depot_tools, Chromium and CEF source code, run Debug and Release builds of CEF, and create a binary distribution package containing the build artifacts in the “/path/to/download/chromium/src/cef/binary_distrib” directory. Future runs of the script will perform the minimum work necessary (unless otherwise configured using command-line flags). For example, if there are no pending CEF or Chromium updates the script will do nothing.
If you run the script and CEF or Chromium updates are pending the “/path/to/download/chromium/src/cef” directory will be removed and replaced with a clean copy from “/path/to/download/cef_(branch)” (specify the --no-update command-line flag to disable updates). Make sure to back up any changes that you made in the “/path/to/download/chromium/src/cef” directory before re-running the script.
The same download directory can be used for building multiple CEF branches (just specify a different --branch command-line value). The existing “/path/to/download/chromium/src/out” directory will be moved to “/path/to/download/out_(previousbranch)” so that the build output from the previous branch is not lost. When you switch back to a previous branch the out directory will be restored to its original location.
The script will create a 32-bit build on Windows by default. To create a 64-bit build on Windows, macOS or Linux specify the --x64-build command-line flag. 32-bit builds on macOS are no longer supported starting with 2272 branch so this flag is now required when building 2272+ on that platform.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
If you receive Git errors when moving an existing checkout from one branch to another you can force a clean Chromium Git checkout (specify the --force-clean command-line flag) and optionally a clean download of Chromium dependencies (specify the --force-clean-deps command-line flag). Any build output that currently exists in the “src/out” directory will be deleted. Re-downloading the Chromium dependencies can take approximately 30 minutes with a reasonably fast internet connection.
Add the --help command-line switch to output a complete list of supported command-line options.
Manual Downloading
See the MasterBuildQuickStart Wiki page for an example of the recommended developer workflow.
Manual Building
See the MasterBuildQuickStart Wiki page for an example of the recommended developer workflow.
Manual Packaging
After building both Debug and Release configurations you can use the make_distrib tool (.bat on Windows, .sh on macOS and Linux) to create a binary distribution.
cd /path/to/chromium/src/cef/tools
./make_distrib.sh --ninja-build
If the process succeeds a binary distribution package will be created in the /path/to/chromium/src/cef/binary_distrib directory.
See the make_distrib.py script for additional usage options.
The resulting binary distribution can then be built using CMake and platform toolchains. See the README.txt file included with the binary distribution for more information.
Build Notes
This section summarizes build-related requirements and options.
Building on most platforms will require at least 8GB of system memory.
Ninja must be used when building newer CEF/Chromium branches.
Clang is used by default for compiling/linking Chromium/CEF on macOS in all branches, Linux starting in 2063 branch, and Windows starting in 3282 branch.
GYP is supported by 2785 branch and older. GN is supported by 2785 branch and newer, and required starting with 2840 branch. Set CEF_USE_GN=1 to build 2785 branch with GN instead of GYP.
To perform a 64-bit build on Windows (any branch) or macOS (branch 2171 or older) set GYP_DEFINES=target_arch=x64 (GYP only) or build the out/[Debug|Release]_GN_x64 target (GN only). To perform a 32-bit Linux build on a 64-bit Linux system see instructions on the AutomatedBuildSetup Wiki page.
To perform an “official” build set GYP_DEFINES=buildtype=Official (GYP only) or GN_DEFINES=is_official_build=true (GN only). This will disable debugging code and enable additional link-time optimizations in Release builds. See instructions on the AutomatedBuildSetup Wiki page for additional official build recommendations.
Windows -
If multiple versions of Visual Studio are installed on your system you can set the GYP_MSVS_VERSION environment variable to create project files for that version. For example, set the value to "2015" for VS2015 or "2017" for VS2017. Check the Chromium documentation for the correct value when using other Visual Studio versions.
If you wish to use Visual Studio for debugging and compiling in combination with a Ninja build you can set GYP_GENERATORS=ninja,msvs-ninja (GYP only) or GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/* (GN only) to generate both Ninja and VS project files. Visual Studio is supported only for debugging and compiling individual source files -- it will not build whole targets successfully. You must use Ninja when building CEF/Chromium targets.
For best local developer (non-official debug) build-time performance:
When using VS2015 set GN_DEFINES=is_win_fastlink=true for improved compile and link time (branches <= 3202).
When using VS2017 or VS2019 set GN_DEFINES=use_jumbo_build=true for improved compile and link time (branches <= 4044).
Component builds are supported by 3202 branch and newer and significantly reduce link time. Add is_component_build=true to GN_DEFINES in combination with the above VS-version-specific values. Component builds cannot be used to create a CEF binary distribution. See issue #1617 for details.
macOS -
The combination of deployment target and base SDK version will determine the platforms supported by the resulting binaries. For proper functioning you must use the versions specified under build requirements for each branch.
32-bit builds are no longer supported with 2272 branch and newer. See here for the Chromium announcement.
Linux -
CEF is developed and tested on the Ubuntu version specified in the "Release Branches" section. It should be possible to build and run CEF on other compatible Linux distributions but this is untested.
The libgtkglext1-dev package is required in branch 1547 and newer to support the off-screen rendering example in cefclient. This is only a requirement for cefclient and not a requirement for other applications using CEF.
Updated 2024-08-29 Wiki
Clone wiki
cef / MasterBuildQuickStart
View
History
This Wiki page provides a quick-start guide for creating a Debug build of CEF/Chromium using the current master (development) branch.
Note to Editors: Changes made to this Wiki page without prior approval via the CEF Forum or Issue Tracker may be lost or reverted.
Overview
File Structure
Windows Setup
Mac OS X Setup
Linux Setup
Next Steps
Overview
This page provides a quick-start guide for setting up a minimal development environment and building the master branch of Chromium/CEF for development purposes. For a comprehensive discussion of the available tools and configurations visit the BranchesAndBuilding Wiki page.
This guide is NOT intended for:
Those seeking a prebuilt binary distribution for use in third-party apps. Go here instead.
Those seeking to build the binary distribution in a completely automated manner. Go here instead.
Development systems can be configured using dedicated hardware or a VMware, Parallels or VirtualBox virtual machine.
The below steps can often be used to develop the most recent release branch of CEF/Chromium in addition to the master branch. Chromium build requirements change over time so review the build requirements listed on the BranchesAndBuilding Wiki page before attempting to build a release branch. Then just add --branch=XXXX to the automate-git.py command-line where "XXXX" is the branch number you wish to build.
File Structure
The same file structure will be used on all platforms. "~" can be any path that does not include spaces or special characters. We'll be building this directory structure for each platform in the following sections.
~/code/
automate/
automate-git.py <-- CEF build script
chromium_git/
cef/ <-- CEF source checkout
chromium/
src/ <-- Chromium source checkout
update.[bat|sh] <-- Bootstrap script for automate-git.py
depot_tools/ <-- Chromium build tools
With this file structure you can develop multiple CEF/Chromium branches side-by-side. For example, repeat the below instructions using "chromium_git1" as the directory name instead of "chromium_git".
Windows Setup
What's Required
Windows Build Requirements as listed on the BranchesAndBuilding Wiki page.
Install required Visual Studio sub-components as described here.
Install the exact Windows SDK version specified in the default location to avoid build issues.
At least 16GB of RAM (32GB+ recommended) and 150GB of free disk space (for a Debug build).
Approximately 4 hours with a fast internet connection (100Mbps) and fast build machine (2.4Ghz, 16 logical cores, SSD).
Step-by-step Guide
All of the below commands should be run using the system "cmd.exe" and not a Cygwin shell.
Create the following directories.
c:\code\automate
c:\code\chromium_git
WARNING: If you change the above directory names/locations make sure to (a) use only ASCII characters and (b) choose a short file path (less than 35 characters total). Otherwise, some tooling may fail later in the build process due to invalid or overly long file paths.
Download depot_tools.zip and extract to "c:\code\depot_tools". Do not use drag-n-drop or copy-n-paste extract from Explorer, this will not extract the hidden ".git" folder which is necessary for depot_tools to auto-update itself. You can use "Extract all..." from the context menu though. 7-zip is also a good tool for this.
Run "update_depot_tools.bat" to install Python and Git.
cd c:\code\depot_tools
update_depot_tools.bat
4. Add the "c:\code\depot_tools" folder to your system PATH. For example, on Windows 10:
Run the "SystemPropertiesAdvanced" command.
Click the "Environment Variables..." button.
Double-click on "Path" under "System variables" to edit the value.
5. Download the automate-git.py script to "c:\code\automate\automate-git.py".
Create the "c:\code\chromium_git\update.bat" script with the following contents.
set GN_DEFINES=is_component_build=true
set GN_ARGUMENTS=--ide=vs2022 --sln=cef --filters=//cef/*
python3 ..\automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --no-distrib --no-build
Run the "update.bat" script and wait for CEF and Chromium source code to download. CEF source code will be downloaded to "c:\code\chromium_git\cef" and Chromium source code will be downloaded to "c:\code\chromium_git\chromium\src". After download completion the CEF source code will be copied to "c:\code\chromium_git\chromium\src\cef".
cd c:\code\chromium_git
update.bat
7. Create the "c:\code\chromium_git\chromium\src\cef\create.bat" script with the following contents.
set GN_DEFINES=is_component_build=true
set GN_ARGUMENTS=--ide=vs2022 --sln=cef --filters=//cef/*
call cef_create_projects.bat
Run the "create.bat" script to generate Ninja and Visual Studio project files.
cd c:\code\chromium_git\chromium\src\cef
create.bat
This will generate a "c:\code\chromium_git\chromium\src\out\Debug_GN_x86\cef.sln" file that can be loaded in Visual Studio for debugging and compiling individual files. Replace “x86” with “x64” in this path to work with the 64-bit build instead of the 32-bit build. Always use Ninja to build the complete project. Repeat this step if you change the project configuration or add/remove files in the GN configuration (BUILD.gn file).
Create a Debug build of CEF/Chromium using Ninja. Edit the CEF source code at "c:\code\chromium_git\chromium\src\cef" and repeat this step multiple times to perform incremental builds while developing.
cd c:\code\chromium_git\chromium\src
autoninja -C out\Debug_GN_x86 cef
Replace "Debug" with "Release" to generate a Release build instead of a Debug build. Replace “x86” with “x64” to generate a 64-bit build instead of a 32-bit build.
Run the resulting cefclient sample application.
cd c:\code\chromium_git\chromium\src
out\Debug_GN_x86\cefclient.exe
See the Windows debugging guide for detailed debugging instructions.
Mac OS X Setup
What's Required
macOS Build Requirements as listed on the BranchesAndBuilding Wiki page.
Building on an Intel Mac is supported with all versions. Building on an Apple Silicon (ARM64) Mac is supported starting with M93 (4577 branch).
At least 16GB of RAM (32GB+ recommended) and 150GB of free disk space (for a Debug build).
Approximately 4 hours with a fast internet connection (100Mbps) and fast build machine (2.4Ghz, 16 logical cores, SSD).
Step-by-step Guide
In this example "" is "/Users/marshall". Note that in some cases the absolute path must be used. Environment variables described in this section can be added to your "/.bash_profile" file to persist them across sessions.
export PATH=/Users/marshall/code/depot_tools:$PATH
4. Download the automate-git.py script to "~/code/automate/automate-git.py".
Create the "~/code/chromium_git/update.sh" script with the following contents.
#!/bin/bash
python3 ../automate/automate-git.py --download-dir=/Users/marshall/code/chromium_git --depot-tools-dir=/Users/marshall/code/depot_tools --no-distrib --no-build --x64-build
⚠ Replace --x64-build with --arm64-build if using an Apple Silicon Mac instead of an Intel Mac.
Give it executable permissions.
cd /code/chromium_git
chmod 755 update.sh
Run the "update.sh" script and wait for CEF and Chromium source code to download. CEF source code will be downloaded to "/code/chromium_git/cef" and Chromium source code will be downloaded to "/code/chromium_git/chromium/src". After download completion the CEF source code will be copied to "/code/chromium_git/chromium/src/cef".
cd /code/chromium_git
./update.sh
6. Run the "/code/chromium_git/chromium/src/cef/cef_create_projects.sh" script to create Ninja project files. Repeat this step if you change the project configuration or add/remove files in the GN configuration (BUILD.gn file).
cd ~/code/chromium_git/chromium/src/cef
./cef_create_projects.sh
⚠ Add export GN_DEFINES=is_component_build=true before running cef_create_projects.sh if using an Apple Silicon Mac instead of an Intel Mac.
Create a Debug build of CEF/Chromium using Ninja. Edit the CEF source code at "~/code/chromium_git/chromium/src/cef" and repeat this step multiple times to perform incremental builds while developing.
cd ~/code/chromium_git/chromium/src
autoninja -C out/Debug_GN_x64 cef
⚠ Replace "x64" with "arm64" if using an Apple Silicon Mac instead of an Intel Mac. Replace "Debug" with "Release" to generate a Release build instead of a Debug build.
Run the resulting cefclient, cefsimple and/or ceftests sample applications.
cd ~/code/chromium_git/chromium/src
open out/Debug_GN_x64/cefclient.app
Or run directly in the console to see log output:
./out/Debug_GN_x64/cefclient.app/Contents/MacOS/cefclient
See the Mac OS X debugging guide for detailed debugging instructions.
Linux Setup
What's Required
Linux Build Requirements as listed on the BranchesAndBuilding Wiki page.
Building with other versions or distros has not been tested and may experience issues.
At least 16GB of RAM (32GB+ recommended) and 120GB of free disk space (for a Debug build).
Approximately 4 hours with a fast internet connection (100Mbps) and fast build machine (2.4Ghz, 16 logical cores, SSD).
Step-by-step Guide
In this example "" is "/home/marshall". Note that in some cases the absolute path must be used. Environment variables described in this section can be added to your "/.profile" or "~/.bashrc" file to persist them across sessions.
Create the following directories.
mkdir ~/code
mkdir ~/code/automate
mkdir /code/chromium_git
2. Download and run "/code/install-build-deps.py" to install build dependencies. Answer Y (yes) to all of the questions.
#!/bin/bash
python3 ../automate/automate-git.py --download-dir=/home/marshall/code/chromium_git --depot-tools-dir=/home/marshall/code/depot_tools --no-distrib --no-build
Give it executable permissions.
cd /code/chromium_git
chmod 755 update.sh
Run the "update.sh" script and wait for CEF and Chromium source code to download. CEF source code will be downloaded to "/code/chromium_git/cef" and Chromium source code will be downloaded to "/code/chromium_git/chromium/src". After download completion the CEF source code will be copied to "/code/chromium_git/chromium/src/cef".
cd ~/code/chromium_git
./update.sh
7. Configure GN_DEFINES for your desired build environment.
Chromium provides sysroot images for consistent builds across Linux distros. The necessary files will have downloaded automatically as part of step 6 above. Usage of Chromium's sysroot is recommended if you don't want to deal with potential build breakages due to incompatibilities with the package or kernel versions that you've installed locally. To use the sysroot image configure the following GN_DEFINES:
export GN_DEFINES="use_sysroot=true use_allocator=none symbol_level=1 is_cfi=false use_thin_lto=false"
It is also possible to build using locally installed packages instead of the provided sysroot. Choosing this option may require additional debugging effort on your part to work through any build errors that result. On Ubuntu 18.04 the following GN_DEFINES have been tested to work reliably:
export GN_DEFINES="use_sysroot=false use_allocator=none symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false"
Note that the "cefclient" target cannot be built directly when using the sysroot image. You can work around this limitation by creating a binary distribution after completing step 9 below, and then building the cefclient target using that binary distribution.
You can also create an AddressSanitizer build for enhanced debugging capabilities. Just add is_asan=true dcheck_always_on=true to the GN_DEFINES listed above and build the out/Release_GN_x64 directory in step 9 below. Run with the asan_symbolize.py script as described in the AddressSanitizer link to get symbolized output.
The various other listed GN arguments are based on recommendations from the AutomateBuildSetup Wiki page. You can search for them by name in the Chromium source code to find more details.
Run the "~/code/chromium_git/chromium/src/cef/cef_create_projects.sh" script to create Ninja project files. Repeat this step if you change the project configuration or add/remove files in the GN configuration (BUILD.gn file).
cd /code/chromium_git/chromium/src/cef
./cef_create_projects.sh
9. Create a Debug build of CEF/Chromium using Ninja. Edit the CEF source code at "/code/chromium_git/chromium/src/cef" and repeat this step multiple times to perform incremental builds while developing. Note the additional "chrome_sandbox" target may be required by step 10. The "cefclient" target will only build successfully if you set use_sysroot=false in step 7, so remove that target if necessary.
cd ~/code/chromium_git/chromium/src
autoninja -C out/Debug_GN_x64 cefclient cefsimple ceftests chrome_sandbox
Replace "Debug" with "Release" to generate a Release build instead of a Debug build.
Set up the Linux SUID sandbox if you are using an older kernel (< 3.8). See here for more background on Linux sandboxing technology.
This environment variable should be set at all times.
cd ~/code/chromium_git/chromium/src
sudo BUILDTYPE=Debug_GN_x64 ./build/update-linux-sandbox.sh
11. Run the cefclient, cefsimple and/or ceftests sample applications. Note that the cefclient application will only have built successfully if you set use_sysroot=false in step 7.
cd ~/code/chromium_git/chromium/src
./out/Debug_GN_x64/cefclient
See the Linux debugging guide for detailed debugging instructions.
Again, I want to make a very minimalistic build of Chromium that's intended to save in file size. For example, I do not need Chrome DevTools. There are a lot of features that I don't need. So can you tell me and walk me through step by step how I can make the most minimalistic possible build of the Chromium browser? With the intention of running it on an embedded device. But the main issue here is how to do this build, how to find what to delete, how to remove Chrome DevTools, for example, which might be a large part of it. So I need advice and step by step instructions on that, please. please.
Creating a minimalistic Chromium build tailored for macOS and Linux involves several steps, including setting up the build environment, configuring build options to exclude unnecessary features (like Chrome DevTools), and compiling the source code. Below is a comprehensive, step-by-step guide to help you achieve a streamlined Chromium build suitable for embedded devices.
Overview
Objective: Build a minimal Chromium browser for macOS and Linux by excluding unnecessary features such as Chrome DevTools to reduce file size.
Tools Used:
depot_tools: A collection of scripts and tools required to fetch and build Chromium.
GN: Generate Ninja build files with specific configurations.
Ninja: A build system used to compile Chromium efficiently.
Prerequisites
For Both macOS and Linux
Hardware Requirements:
RAM: Minimum 16GB (32GB+ recommended for faster builds).
Disk Space: At least 150GB free.
Processor: Multi-core CPU (e.g., 8+ cores) for parallel builds.
Software Requirements:
Python 3: Required for depot_tools and build scripts.
Git: Version control system for fetching the Chromium source.
Build Dependencies: Specific to each OS (detailed below).
depot_tools is essential for fetching and building the Chromium source code.
Clone depot_tools:
bash
mkdir ~/chromium
cd ~/chromium
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Add depot_tools to PATH:
macOS/Linux:
Add the following line to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
bash
export PATH="$HOME/chromium/depot_tools:$PATH"
Apply the changes:
bash
source ~/.bashrc # or source ~/.zshrc
Step 3: Fetch Chromium Source Code
Create a Directory for Chromium Source:
bash
mkdir ~/chromium/src
cd ~/chromium/src
Fetch the Chromium Source:
bash
fetch --nohooks chromium
Note: This step can take several hours and requires ample disk space and a stable internet connection.
Navigate to Source Directory:
bash
cd src
Synchronize Dependencies:
bash
gclient sync
Step 4: Configure Build for Minimal Chromium
Chromium uses GN (Generate Ninja) to configure build options. To create a minimal build, you'll need to set specific GN flags to exclude unnecessary features.
Navigate to the Source Directory:
bash
cd ~/chromium/src
Create a Build Directory:
bash
mkdir out/Minimal
Generate args.gn with Minimal Configuration:
Use gn to set build flags. Below is an example of args.gn content to minimize the build:
bash
gn args out/Minimal
This command will open a text editor. Populate it with the following configurations:
Important: Some flags like disable_devtools are not standard GN flags. Chromium does not provide a disable_devtools flag directly. Instead, you need to disable specific components related to DevTools.
Correct Configuration with Actual Flags:
To accurately disable DevTools and other features, adjust args.gn as follows:
For a more streamlined build, you can tweak additional GN flags and exclude specific components manually.
Exclude Specific Targets:
Modify the BUILD.gn files in relevant directories to exclude targets like DevTools. For example, in chromium/src/third_party, you can comment out or remove entries related to DevTools.
Use --with-flags:
Alternatively, pass additional flags directly when generating GN build files:
Warning: Stripping symbols makes debugging difficult. Perform this step only for release builds intended for deployment.
B. Remove Unnecessary Files
Delete resources and files not required for your specific use case:
Locales:
If your application targets specific languages, remove others to save space.
bash
rm -rf out/Minimal/Chromium.app/Contents/Resources/locales/*.pak # macOS
rm -rf out/Minimal/chrome/locales/*.pak # Linux
Alternatively, keep only the needed .pak files.
Extensions and Plugins Folders:
bash
rm -rf out/Minimal/Chromium.app/Contents/Extensions # macOS
rm -rf out/Minimal/chrome/extensions # Linux
Documentation and Help Files:
bash
rm -rf out/Minimal/Chromium.app/Contents/Resources/chrome_100_percent.pak # Example
rm -rf out/Minimal/chrome/resources/*.pak # Linux
Note: Be cautious to remove only non-essential resources.
C. Compress Binaries
For distribution, compress the Chromium binary using tools like upx:
Install UPX:
macOS:
bash
brew install upx
Linux:
bash
sudo apt-get install upx
Compress the Binary:
bash
upx --best out/Minimal/chrome
Warning: Compressed binaries may have slower startup times and can complicate debugging.
Step 9: Verify the Minimal Build
Run Chromium:
macOS:
bash
open out/Minimal/Chromium.app
Linux:
bash
./out/Minimal/chrome
Test Functionality:
Ensure that only the necessary features are present and that excluded components (like DevTools) are not available.
Validate Size Reduction:
Compare the size of the minimal build with a standard Chromium build to confirm the reduction.
Additional Tips for Minimizing Build Size
Use symbol_level = 0:
Already set in args.gn, this removes debug symbols from the build.
Disable Unused APIs:
Identify and disable APIs your application doesn't use, reducing the binary size.
Minimize Features:
Continuously evaluate which Chromium features are essential for your use case and disable others via GN flags.
Custom Patching:
For extreme minimization, consider patching the Chromium source to remove or comment out code related to unwanted features. This requires in-depth knowledge of Chromium’s codebase.
Leverage CEF (Chromium Embedded Framework):
If your application embeds Chromium, using CEF might provide additional flexibility in reducing build size. Refer to CEF’s build configuration options.
Building a minimalistic Chromium browser involves carefully configuring build options to exclude unnecessary components, thereby reducing the final binary size. By following the steps outlined above, you can achieve a streamlined Chromium build optimized for embedded devices on both macOS and Linux platforms. Always ensure thorough testing to verify that essential functionality remains intact after stripping away components.
If you encounter issues or need further customization, refer to the Chromium Developer Documentation or seek assistance from the Chromium developer community.
Dataset releases
Not yet included in a published release.
Explanation of Key Flags:
is_component_build = false: Builds Chromium as a monolithic binary, reducing complexity and size.
is_debug = false: Builds Chromium in Release mode, enabling optimizations.
symbol_level = 0: Excludes debug symbols to minimize binary size.