1)下載depot_tools,zip下載不了,直接git clone下
2)depot_tools加環境變數
3)gclient sync
a)python下載安裝不了,可以手動安裝python2.7.6,複製python.exe到depot_tools
b)git下載安裝不了,可以手動安裝git,設定環境變數到bin路徑
c)sync先會下載chromium.src,有1.5G,如果用gclient sync會老是出錯,因為太大了,國內環境大家都懂的。所以推薦使用github用戶端來clone,clone下來後重新命名到node-webkit/src
d)以後會clone88個工程,這個過程很懊惱,會話很久時間,googlesource.com網路有不是很穩定,所以先自己加個網域名稱解析,會快點,如果是github的項目,建議跟c)一樣,用用戶端下載後放入目錄。這裡clone的都是chromium.src下的DEPS.git檔案裡的設定項目
e)88個項目都clone完成後,gclient會安裝llvm/clang,然後編譯。我使用的是OS X 11,編譯時間候老是提示clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) ,
解決方案為修改
node_webkit/src/tools/clang/scripts/update.sh MACOSX_DEPLOYMENT_TARGET=10.5 ==> MACOSX_DEPLOYMENT_TARGET=10.7
f)On OSX you’ll see error messages reporting cycle in .gyp file dependency graph detected. It can be ignored because gclient wants to run gyp_chromium without a switch we need. Please move on to the Build section
Error: Command /usr/bin/python src/build/gyp_chromium returned non-zero exit status 1 in /Users/gexin/Documents/nw_workspace/node_webkit
Hook ‘/usr/bin/python src/build/gyp_chromium’ took 42.73 secs
g)cd node-webkit/src
export GYP_GENERATORS=‘ninja’
./build/gyp_chromium content/content.gyp
ninja -C out/Release nw -j4