1 ################################################################################
3 # ninja.cygclass - functions for building Ninja-based packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****h* Cygclasses/ninja.cygclass
28 # Ninja is a build system with a focus on speed. It is designed to have its
29 # input files (named ninja.build) generated by a higher-level build system,
30 # such as CMake or Meson.
37 #****C* ninja.cygclass/cygninja
41 # Runs 'ninja' with the given arguments.
44 if ! inherited meson && [ ! -e build.ninja ]
46 error "cygninja: build.ninja: file not found"
48 ninja ${_nproc} ${@} || error "cygninja: command failed: ${@:-all}"
51 #****T* ninja.cygclass/ninja_test
53 # Runs the package's test suite with 'ninja check'. Any arguments to
54 # ninja_test are passed along. ninja_test must be run from the directory
55 # containing 'build.ninja'.
61 #****I* ninja.cygclass/ninja_install
63 # Installs the package into $D with 'ninja install'. Any arguments to
64 # ninja_install are passed along. ninja_install must be run from the directory
65 # containing 'build.ninja'.
68 DESTDIR=${D} cygninja install ${@}
71 readonly -f cygninja ninja_test ninja_install