v8 빌드 방식이 바뀌어서 이전에 Scons 을 쓰는 것은 deprecated 되었다.

 

GYP 빌드 메타 정보를 생성하는 방법을 사용하는데 윈도우 & MSVC 2010 환경에서 빌드 하는 방법을 정리한다.

 

 

아래 순서로 빌드하면됨

 

1. 소스 다운로드

svn checkout http://v8.googlecode.com/svn/trunk/ v8

2. gyp 다운로드 (v8 빌드를 위한 메타 정보라고 함)

svn co http://gyp.googlecode.com/svn/trunk build/gyp

3. chromium python 다운로드 후 설치

svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111 third_party/python_26

4. chromium 제공  cygwin 설치

svn co  http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844 third_party/cygwin

5. visual studio 용 sln 파일 만들기

third_party\python_26\python.exe build\gyp_v8 -G msvs_version=2010

Updating projects from gyp files...

만들어진 all.sln 파일을 열고 msvc 에서 빌드 하는데... 아마도  code page 에러 (C4819 warning)가 발생할 것이다.

warning 중간에 나오는 error들도  warning 다량발생을 인한 2차적인 에러이므로 c4819만 잡으면 된다.

===================== 발생 에러 =======================

v8\src\utils.h : error C2220: warning treated as error - no 'object' file generated

v8\src\utils.h : warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss

===============================================================

조치 하는 방법은  해당 솔루션에 포함된 프로젝트들(아래그림 참고) 중  소스를 포함하는 프로젝트들을 선택하여 C4819 Warning 이 안 뜨도록 억제해주면 된다.

파란색으로 선택된 프로젝트들만 선택하고 12개 프로젝트 선택하고 속성 창을 띄운다.

선택한뒤  Properties (속성) 창을 띄운다.

그리고 Disable Specific Warnings 에 4819를 추가해줍니다. (아래그림참고)

그리고 나서 빌드 하면 잘됨..




Pre-requisites for all platforms are:

    Subversion 1.4 or higher - see http://sourceforge.net/projects/win32svn/
    Python 2.4 or higher - see http://www.python.org
    SCons 1.0.0 or higher - see http://www.scons.org


Phase 1.  Download V8 source  by SVN

>svn svn checkout http://v8.googlecode.com/svn/trunk/ v8-read-only

>cd v8-read-only

Phase 2. Prepare environment values for MSVC++ 2010

>"C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

Phase 3. build V8  for shared library.

#for release mode library
>scons mode=release library=shared msvcrt=shared env="PATH:%PATH%,LIB:%LIB%,INCLUDE:%INCLUDE%" d8



#for debug mode library
>scons mode=debug library=shared msvcrt=shared env="PATH:%PATH%,LIB:%LIB%,INCLUDE:%INCLUDE%" d8



( When I was choose static mode. V8.lib was too large size more than 200MB and too slow to use in my application build and there were several problems. but shared mode was good! so I suggest shared(dll) mode )

Good luck!

I referred following links.
http://code.google.com/intl/ko-KR/apis/v8/build.html
http://code.google.com/p/v8/wiki/BuildingOnWindows



+ Recent posts