Ninja equivalent of Make's “build from this directory down” feature (with CMake)?

前端 未结 3 2278
小蘑菇
小蘑菇 2021-02-15 14:12

When building a project using CMake and Make, you can execute make from a subdirectory of your build tree (i.e. from a directory below whatever directory contains y

3条回答
  •  猫巷女王i
    2021-02-15 14:59

    ninja

    /all works with recent versions of Ninja (1.7.2). Version 1.3.4 does not allow this.

    I could not find a reference to this on the manual. However, CMake has this documented here:

    Recent versions of the ninja program can build the project through the “all” target. An “install” target is also provided.

    For each subdirectory sub/dir of the project, additional targets are generated:

    • sub/dir/all
      Depends on all targets required by the subdirectory.
    • sub/dir/install
      Runs the install step in the subdirectory, if any.
    • sub/dir/test
      Runs the test step in the subdirectory, if any.
    • sub/dir/package
      Runs the package step in the subdirectory, if any.

提交回复
热议问题