-
Chromium 을 Windows에서 gn 빌드공장 이야기 2016. 6. 29. 21:09
현재 chrome를 빌드 하는 방법은 "GYP", "gn" 두 가지로 알고 있다. 나 머진 나도 잘.ㅋ ㅌㅌㅌ
일단 gn 만의 장점이 있으니 여기서 소개를...ㅎ gyp에서 gn 으로 가게된 이유는... 빌드 후 실행할 때 chrome가 dll을 너무 많이 물고 올라오는 문제가 있어서
일단 기준은 Visual Studio 2015 에...
Windows 7 이상???
RAM 8메가
하드 30기가를 권장하고 있다. 구글이.ㅋ 맞냐???
빌드해서 나온 결과는 x86, x64 다 지원...
0.문서
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
http://dev.chromium.org/developers/how-tos/get-the-code
https://github.com/henrypp/chromium/blob/master/building_chromium_gn.md
https://github.com/henrypp/chromium/blob/master/building_chromium_gyp.md
http://www.chromium.org/developers/gyp-environment-variables
https://docs.microsoft.com/ko-kr/windows-hardware/drivers/download-the-wdk << 설치
1. 영문 윈도우(Window 10 권장)에 설치하여야 함
: 예전 한글 윈도우에서 44 버전을 빌드할려고 시도한적이 있었다... 능력이 모자라 일주일 피떵만...
2. VisualStudio 2015 Community(영문버전 권장) 설치 (Microsoft Foundation Classes for C++ 포함) / SP3 이상 설치
3. depot_tools 설치 (7zip으로 압축 해제 후 폴더 복사)
4. 환경 변수 path에 depot_tools의 path 추가 및 환경 변수 생성
변수명 변수값 DEPOT_TOOLS_WIN_TOOLCHAIN 0 GYP_CHROMIUM_NO_ACTION 1 GN_ARGUMENTS GYP_GENERATORS--ide=vs2019(GN 빌드 시) msvs-ninja,ninja(GYP 빌드 시)GYP_MSVS_VERSION 2019 5. depot_tools경로로 이동 후 gclient 실행
6. git 초기화 ( 최초 1회만 )
git config --global user.name "John Doe"
git config --global user.email "jdoe@email.com"
git config --global core.autocrlf false
git config --global core.filemode false
git config --global color.ui true7. NTFS파티션에 소스를 다운로드할 폴더 생성 후 해당 폴더로 이동 (root라고 가정)
8. source download를 위해 fetch 실행
fetch --nohooks chromium --nosvn=True
9. source downgrade
https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches
cd src
git pull
git fetch --tags
소스 버전 맞추기
git checkout -b [branch name] [tag name]
ex) git checkout -b branch_work 52.0.2743.6810. 빌드 옵션 설정을 위 한 args.gn 파일 생성
src 폴더 밑에서
gn gen out\Release_x64 <<< 폴더 및 빌드 파일 생성
gn args "폴더 명" ex) => gn args out\Release_x64
실행 후 열려지는 notepad에 아래 옵션 입력
https://github.com/macchrome/winchrome/releases <<< 참조
* Release 빌드 시...
chrome_pgo_phase = 1
current_cpu = "x64"
#enable_iterator_debugging = false
#enable_nacl = false
#ffmpeg_branding = "Chrome"
is_official_build=true
is_debug = false
#is_win_fastlink = false
#proprietary_codecs = true
symbol_level = 0
target_cpu = "x64"
visual_studio_version = "2017"
* Debug 빌드 시...
chrome_pgo_phase = 1
current_cpu = "x64"
#enable_iterator_debugging = true
#enable_nacl = true
#ffmpeg_branding = "Chrome"
#is_component_build = true
is_debug = true
#is_win_fastlink = true
#proprietary_codecs = true
symbol_level = 2
#blink_symbol_level = 2
target_cpu = "x64"
visual_studio_version = "2019"
11. 아래 명령을 실행하여 debug 버전 / release 버전의 chromium.exe 파일이 생성되면 모든 빌드과정이 완료된다.http://dev.chromium.org/developers/how-tos/get-the-code
debug버전 : ninja -C out\Debug_x64 chrome
release버전 : ninja -C out\Release_x64 chrome
- Cleaning...
ninja -C out/Debug_x64 -t clean12. visual studio에서 project 열기
해당 .sln 을 생성 하기 위해 src 폴더에서
gn gen out\Release_x64 --ide="vs"
위치 : src\”빌드 경로”\all.sln ex) => src\out\Release_x64\all.sln13. mini installer
ninja -C out\Release_x64 mini_installer
14. 디버깅 방법
.sln 프로젝트 파일 열기 ex) => src\out\Debug_x64\all.sln
아래 그림과 같이 chrome 로 StartUp Project 변경PS. Chrome 52.0.2743.68 버전의
void BubbleFrameView::Layout() { 이따위 함수에서...
bounds.y() + (title_height - title_->height()) / 2 <<< 이넘을 넣은 넘은 나 같은 넘인듯... 산수가 안되든지!!! 검증을 안하는???
당최 의도가 뭐냐??? 중앙 정렬이 싫은???
'공장 이야기' 카테고리의 다른 글
JCEF Window 빌드 (0) 2020.04.07 Modal Dialog 만들기...ㅎ (0) 2017.11.30 Linux에서 chromium 빌드 하기 (0) 2015.12.30 chromium x64 Win7 빌드 (0) 2015.12.16 Node.JS 설정 변경 시 (0) 2015.08.11