Ninja Build

6147 단어 chromiumninja
NinjaBuild  
Using the Ninja build system 
build
Updated 
Mar 28, 2014 by  [email protected]
  • Using it
  • Configure your system to use Ninja

  • Build instructions
  • Android
  • Windows
  • Debugging
  • Without Visual Studio

  • Tweaks
  • Building through errors
  • Parallelism
  • More options
  • Custom build configs

  • Bugs

  • Ninja is a build system written with the specific goal of improving the edit-compile cycle time. It is used by default everywhere except when building for iOS.
    Ninja는 컴파일 주기 절약에 주력하는 컴파일 시스템으로 OS를 제외한 나머지는 모두 사용할 수 있다.
    Ninja behaves very similar to Make -- the major feature is that it starts building files nearly instantly. (It has a number of minor user interface improvements to make as well.)
    Ninja와 Make의 표현 방식이 유사하다--주요 특진은 즉각 번역이다
    Read more about Ninja at the Ninja home page.
    Using it
    Configure your system to use Ninja
    Install
    Ninja is included in depot_tools as well as gyp, so there's nothing to install.
    Build instructions
    To build Chrome:
    cd /path/to/chrome/src
    ninja -C out/Debug chrome

    Specify out/Release for a release build. I recommend setting up an alias so that you don't need to type out that build directory path.
    If you want to build all targets, use ninja -C out/Debug all. It's faster to build only the target you're working on, like 'chrome' or 'unit_tests'.
    Android
    Identical to Linux, just make sure OS=android is in your GYP_DEFINES. You want to build one of the apk targets, e.g. content_shell_apk.
    Windows
    Similar to Linux. It uses MSVS's cl.exe, link.exe, etc. so you still need to have VS installed. To use it, open cmd.exe, go to your chrome checkout, and run:
    Linux와 유사하며 MSVS's cl.exe, link를 사용합니다.exe, 따라서 VS를 설치해야 합니다. 구체적인 사용 방식은 다음과 같습니다. cmd를 사용하고 디렉터리를 크롬으로 전환합니다.
    set GYP_DEFINES=component=shared_library
    python build\gyp_chromium
    ninja -C out\Debug chrome.exe

    component=shared_library optional but recommended for faster links.
    선택할 수 있지만, 더욱 빨리 링크할 수 있도록 설정하는 것을 권장합니다
    You can also set GYP_GENERATORS=ninja,msvs to get both VS projects generated if you want to use VS just to browse/edit (but then gyp takes twice as long to run).
     GYP_GENERATORS=ninja, msvs는 ninja와 VS 프로젝트를 가져오는 데 사용되며 그중 하나를 선택할 수 있습니다
    If you're using Express or the Windows SDK by itself (rather than using a Visual Studio install), you'll need to run from a vcvarsall command prompt.
    Express 버전이나 Windows SDK (Vs가 설치되어 있지 않은 경우) 를 사용하려면 vcvarsall 명령 알림부호에서 실행해야 합니다
    Debugging
    Miss VS for debugging?
    devenv.com /debugexe chrome.exe --my-great-args "go here" --single-process etc

    Miss Xcode for debugging? Read http://dev.chromium.org/developers/debugging-on-os-x/building-with-ninja-debugging-with-xcode
    Without Visual Studio
    That is, building with just the WinDDK. This is documented in the regular build instructions.
    Tweaks
    Building through errors
    Pass a flag like -k3 to make Ninja build until it hits three errors instead of stopping at the first.
    Parallelism
    Pass a flag like -j8 to use 8 parallel processes, or -j1 to compile just one at a time (helpful if you're getting weird compiler errors). By default Ninja tries to use all your processors.
    More options
    There are more options. Run ninja --help to see them all.
    Custom build configs
    You can write a specific build config to a specific output directory via the -G flags to gyp. Here's an example from jamesr: build/gyp_chromium -Gconfig=Release -Goutput_dir=out_profiling -Dprofiling=1 -Dlinux_fpic=0
    Bugs
    If you encounter any problems, please file a bug at http://crbug.com/new with label ninja and cc thakis@ or scottmg@. Assume that it is a bug in Ninja before you bother anyone about e.g. link problems.

    좋은 웹페이지 즐겨찾기