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