当前位置: 首页 > 工具软件 > Ninja Web > 使用案例 >

C++学习(二二三)有关ninja

南门欣怡
2023-12-01

官网:https://ninja-build.org/

Ninja是一个注重速度的小型构建系统。它与其他构建系统在两个主要方面不同:它被设计为使其输入文件由更高级别的构建系统生成,并且被设计为尽可能快地运行构建。

ninja替代make

CMake工具会生成一个build.ninja文件

再用ninja -f build.ninja生成程序。

用ninja intall安装程序

 

注意:都必须在程序目录执行,也就是build.ninja所在的目录

 

ninja install命令竟然在帮助里没有!!!

 

ninja.exe -help
usage: ninja [options] [targets...]

if targets are unspecified, builds the 'default' target (see manual).

options:
  --version      print ninja version ("1.10.2")
  -v, --verbose  show all command lines while building

  -C DIR   change to DIR before doing anything else
  -f FILE  specify input build file [default=build.ninja]

  -j N     run N jobs in parallel (0 means infinity) [default=14 on this system]
  -k N     keep going until N jobs fail (0 means infinity) [default=1]
  -l N     do not start new jobs if the load average is greater than N
  -n       dry run (don't run commands but act like they succeeded)

  -d MODE  enable debugging (use '-d list' to list modes)
  -t TOOL  run a subtool (use '-t list' to list subtools)
    terminates toplevel options; further flags are passed to the tool
  -w FLAG  adjust warnings (use '-w list' to list warnings)
ninja.exe -t list

ninja subtools:
    browse  browse dependency graph in a web browser
      msvc  build helper for MSVC cl.exe (EXPERIMENTAL)
     clean  clean built files
  commands  list all commands required to rebuild given targets
      deps  show dependencies stored in the deps log
     graph  output graphviz dot file for targets
     query  show inputs/outputs for a path
   targets  list targets by their rule or depth in the DAG
    compdb  dump JSON compilation database to stdout
 recompact  recompacts ninja-internal data structures
    restat  restats all outputs in the build log
     rules  list all rules
 cleandead  clean built files that are no longer produced by the manifest

 

 

 

 类似资料: