CEF 빌드2
예전에 빌드는 cef 공식 문서에 나온대로만 하면 다운로드 후 빌드가 잘되었는데... 이제는(내기준 cef 5359/chromium 108.0.5359.125) 다운로드시 실패하는 케이스가 많아 진다...
https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md <<< 공식문서...
몇일째 고생을...
이전 2021.06.09 - [공장 이야기] - CEF 빌드 방법 정리 한것...
방법을 좀 바꾸어서 chromium 소스를 다운 받아서 cef 빌드 환경을 만드는 것으로 방향을 바꾸기로...
depot_tool 다운과 automate-git.py 는 공식, 이전 문서랑 동일.
공식 문서에 따라 다음과 같은 구조의 디렉터리를 만든다.
~/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
다운 받은 depot_tools을 7zip로 압축을 푼다.
cd ~/code/depot_tools 이동힌 후 gclient sync 입력. 만약 아래와 같은 메시지가 나온다면 "Y" 을 입력.
"Your depot_tools checkout is configured to fetch from an obsolete URL
Would you like to update it? [y/N]:"
다시 cd ~/code/chromium_git/ 이동 후
cmd에 mk chromium 다시 cd chromium 이동 후 cmd에 fetch chromium 입력해서 소스 다운.
다시 "Your depot_tools checkout is configured to fetch from an obsolete URL
Would you like to update it? [y/N]:" 나온다면 또 "Y"...
cmd 에 아래 입력
set PYTHONUTF8=1
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
gclient sync
cd src
git pull
git fetch --tags
git checkout -b 108.0.5359.125 108.0.5359.125 <<< chromium 버전 맟춘 후
gclient sync --with_branch_heads -f -R
작업할 branch(5359) 문서(CHROMIUM_BUILD_COMPATIBILITY.txt)에 보면 아래와 같이 depot_tools_checkout 이 나온다.
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-development
cd ~/code/depot_tools 이동힌후 git checkout 64b6175557 이 후 update_depot_tools.bat 입력 후 엔터.
다시 cd ~/code/chromium_git/ 이동 후 update.bat 생성 아래와 같이 입력.
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GN_DEFINES=is_component_build=false is_official_build=true use_thin_lto=false chrome_pgo_phase=0
set GN_ARGUMENTS=--ide=vs2019 --sln=cef --filters=//cef/*
set CEF_ARCHIVE_FORMAT=tar.bz2
python3 ..\automate\automate-git.py --download-dir=~\code\chromium_git --branch=5359 --depot-tools-dir=~\code\depot_tools --minimal-distrib --client-distrib --force-clean --x64-build --no-depot-tools-update --with-pgo-profiles --force-config
set DEPOT_TOOLS_WIN_TOOLCHAIN=0, chrome_pgo_phase=0, --no-depot-tools-update, --force-config
위 내용이 적용되지 않으면 오류가 발생 할 수도...
아... 더디어 다운 후 빌드까지 완료... 한 4~5일은 삽질한 듯...
Marshall Greenblatt 님하 해결 좀~~~
PS.
cmd로 빌드 후... visual studio로 디버깅 할려고 보면 아래와 같은 오류를 만날 수도 있다.
1>'ninja.exe' is not recognized as an internal or external command,
1>operable program or batch file.
1>E:\cef\chromium_git\chromium\src\out\Debug_GN_x64\obj\cef\cefclient.vcxproj(494,5): error MSB3073: "call ninja.exe -C E:\cef\chromium_git\chromium\src\out\Debug_GN_x64\ cefclient.exe" 명령이 종료되었습니다(코드: 1).
cmd로 ninja 빌드 후 visual studio로 디버깅 할려고 한건데 대략 난감... 예전엔 이런일이 없었는데... 흠...
ninja는 src\third_party\ninja 에 있다. Windows 환걍변수 Path를 잡아준다.