How to compile or use CefSharp with a custom CEF build #5090
Replies: 4 comments 5 replies
-
|
I haven't built
Basic CEF build instructions for creating a release build are at https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-windows-configuration Don't follow the Building with proprietary codecs should just require some additional For reference https://www.magpcss.org/ceforum/viewtopic.php?f=18&t=19221
Once you have a
It depends on what your aim is here. Is it to build a custom version of The easiest option is to build the exact same commit as If you want to build There are some instructions at https://github.com/cefsharp/cef-binary/wiki
If you only want to package some of the three architectures then you can now pass in an argument for that cefsharp/cef-binary#100 (comment) Once you have Clone If you are using a different build version than the one https://github.com/cefsharp/CefSharp/blob/master/UpdateNugetPackages.ps1 Again there's a https://github.com/cefsharp/CefSharp/blob/master/build.ps1 The https://github.com/cefsharp/CefSharp/blob/master/appveyor.yml#L11 IF YOU BUILD CEFSHARP WITH VS2022 THEN YOU'LL NEED VC++ 2022 Redist |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, will let you know how lucky I was. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @amaitland, Thank you for sharing details above, this really helps after 4 days of digging around and following not wrong but different methods without success. What is fastest / easiest method for building custom libs (dll's etc) in order to use them and copy them over the already built project (WinForms example)? I would assume, the steps would be:
I don't mind copy-pasting every time if that's all it takes just to have H264 supports. Automated post-build script can be ran in VS2022, so would not worry about that step. Can you advise on this please as I can se a lot of forum posts but it's very missleading. Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
I've just completed build of CEF with H264 support and integrated into my application. This is minimal (I guess) that needs to be done. For those who are looking for solution. Preparation
Folder structureCreate folder structure as following: ToolingDownload ane extract it's content to Install Ninja using one of desired methods: BAT script configCreate bash script with content below and save it to Update tools by navigating to directory using cmd: And executing: cd c:\code\depot_tools>update_depot_tools.batUpdate script update.bat@echo off
:: --- Essential GN Flags for Proprietary Codecs ---
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome chrome_pgo_phase=0
set GN_ARGUMENTS=--ide=vs2022 --sln=cef --filters=//cef/*
echo Downloading CEF source and Chromium dependencies...
:: python or python3, how ever is configured
python3 ..\automate\automate-git.py --download-dir=c:\code\chromium_git --x64-build --depot-tools-dir=c:\code\depot_tools --branch=7390
:: Add --x64-build to build x64 version
:: Optional params, we dont use them --no-build --no-distrib --no-build --mode=release
:: The branch number '7390' corresponds to your Chromium/CEF version in our case 141.0.7390 for CefSharp 141.0.110BuildingRun in Command Prompt (CMD): cd c:\code\chromium_git>update.batCompailer may complain about Build will take 1+ hours to complete. It may stop with errors 429 and if it does wait for 30-60 minutes and re-run update.bat again. Google has rate limiting to prevent abuse and blocks large number of requests. But don't worry, script will continue where it failed. Also you may get "Access Denied" on files and folders. I've ran into issues multiple times and to prevent any issues disable your antivirus software. Builds completedOnce builds are completed console output below will be shown indicating settings params used in build. 1h37m56.60s Build Succeeded: 57323 steps - 9.75/s
--> c:\code\chromium_git\chromium\src\out\Release_GN_x64\args.gn contents:
alternate_cdm_storage_id_key="968b476909da4373bxxxxxxxxxx"
chrome_pgo_phase=0
clang_use_chrome_plugins=false
disable_fieldtrial_testing_config=true
enable_background_mode=false
enable_cdm_host_verification=true
enable_cdm_storage_id=true
enable_downgrade_processing=false
enable_resource_allowlist_generation=false
enable_rlz=true
enable_widevine=true
ffmpeg_branding="Chrome"
is_component_build=false
is_debug=false
is_official_build=true
optimize_webui=true
proprietary_codecs=true
target_cpu="x64"Versions and filesLocating files that we need depending on platform and OS. In our case we are building for Release and x64. Files built in compile time will be exprted to: libcef.dllThere are other files that aren't relevant that much right now. chrome_100_percent.pak
chrome_200_percent.pak
chrome_elf.dll
d3dcompiler_47.dll
dxcompiler.dll
libEGL.dll
libGLESv2.dll
snapshot_blob.bin
v8_context_snapshot.binDebugWe will use this file to replace one in out project build. ReleaseWe need to copy libcef.dll to our project output eg. C:\YourProjectFolder\ApplicationOutput\Release\net481\x64 Resources: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can you provide any insights of what needs to be done to achieve:
2.- Create a Custom CEF build and be able to use it on CefSharp?
Basically Know the requirements to create a compatible build so can more/less be on sync with your releases.
Beta Was this translation helpful? Give feedback.
All reactions