Skip to content

Commit d74fcf1

Browse files
Merge pull request #31 from kokkiemouse/ninja-build
Use Ninja build
2 parents 07bee20 + 8626d6b commit d74fcf1

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# SPDX-License-Identifier: BSD-2-Clause
33

44
FROM kdeneon/all:user
5-
RUN sudo apt-get update && sudo apt-get -y install build-essential cmake extra-cmake-modules gettext kio-dev libatasmart-dev libboost-python-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5parts-dev libkf5service-dev libkf5solid-dev libkpmcore-dev libparted-dev libpolkit-qt5-1-dev libqt5svg5-dev libqt5webkit5-dev libyaml-cpp-dev os-prober pkg-config python3-dev qtbase5-dev qtdeclarative5-dev qttools5-dev qttools5-dev-tools
5+
RUN sudo apt update && sudo apt -y install build-essential cmake extra-cmake-modules gettext kio-dev libatasmart-dev libboost-python-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5parts-dev libkf5service-dev libkf5solid-dev libkpmcore-dev libparted-dev libpolkit-qt5-1-dev libqt5svg5-dev libqt5webkit5-dev libyaml-cpp-dev os-prober pkg-config python3-dev qtbase5-dev qtdeclarative5-dev qttools5-dev qttools5-dev-tools ninja-build

ci/AppImage.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
### END USAGE
6565

6666
TOOLS_DIR="."
67-
CMAKE_ARGS=""
67+
CMAKE_ARGS="-GNinja"
6868
DO_REBUILD="true"
6969
DO_CONDA="false"
7070
CONFIG_DIR=""
@@ -182,17 +182,17 @@ if $DO_REBUILD ; then
182182
cd "$BUILD_DIR/build" &&
183183
cmake "$SRC_DIR" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib $CMAKE_ARGS
184184
) >> "$LOG_FILE" 2>&1 || { tail -10 "$LOG_FILE" ; echo "! Could not run CMake"; exit 1; }
185-
echo "# Running make ..."
185+
echo "# Running ninja ..."
186186
(
187187
cd "$BUILD_DIR/build" &&
188-
make -j4
189-
) >> "$LOG_FILE" 2>&1 || { tail -10 "$LOG_FILE" ; echo "! Could not run make"; exit 1; }
188+
ninja -j4
189+
) >> "$LOG_FILE" 2>&1 || { tail -10 "$LOG_FILE" ; echo "! Could not run ninja"; exit 1; }
190190
fi
191-
echo "# Running make install ..."
191+
echo "# Running ninja install ..."
192192
(
193193
cd "$BUILD_DIR/build" &&
194-
make install DESTDIR=../AppDir
195-
) >> "$LOG_FILE" 2>&1 || { tail -10 "$LOG_FILE" ; echo "! Could not run make install"; exit 1; }
194+
DESTDIR=../AppDir ninja install
195+
) >> "$LOG_FILE" 2>&1 || { tail -10 "$LOG_FILE" ; echo "! Could not run ninja install"; exit 1; }
196196

197197
### Modify installation
198198
#

ci/RELEASE.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ BUILDDIR=$(mktemp -d --suffix=-build --tmpdir=.)
8080
if test "x$BUILD_DEFAULT" = "xtrue" ; then
8181
rm -rf "$BUILDDIR"
8282
mkdir "$BUILDDIR" || { echo "Could not create build directory." ; exit 1 ; }
83-
( cd "$BUILDDIR" && cmake .. && make -j4 ) || { echo "Could not perform test-build in $BUILDDIR." ; exit 1 ; }
84-
( cd "$BUILDDIR" && make test ) || { echo "Tests failed in $BUILDDIR ." ; exit 1 ; }
83+
( cd "$BUILDDIR" && cmake -GNinja .. && ninja -j4 ) || { echo "Could not perform test-build in $BUILDDIR." ; exit 1 ; }
84+
( cd "$BUILDDIR" && ninja test ) || { echo "Tests failed in $BUILDDIR ." ; exit 1 ; }
8585
fi
8686

8787
### Build with clang
@@ -92,8 +92,8 @@ if test "x$BUILD_CLANG" = "xtrue" ; then
9292
# Do build again with clang
9393
rm -rf "$BUILDDIR"
9494
mkdir "$BUILDDIR" || { echo "Could not create build directory." ; exit 1 ; }
95-
( cd "$BUILDDIR" && CC=clang CXX=clang++ cmake .. && make -j4 ) || { echo "Could not perform test-build in $BUILDDIR." ; exit 1 ; }
96-
( cd "$BUILDDIR" && make test ) || { echo "Tests failed in $BUILDDIR (clang)." ; exit 1 ; }
95+
( cd "$BUILDDIR" && CC=clang CXX=clang++ cmake -GNinja .. && ninja -j4 ) || { echo "Could not perform test-build in $BUILDDIR." ; exit 1 ; }
96+
( cd "$BUILDDIR" && ninja test ) || { echo "Tests failed in $BUILDDIR (clang)." ; exit 1 ; }
9797
fi
9898
fi
9999

@@ -109,13 +109,13 @@ else
109109
# Presumably -B was given; just do the cmake part
110110
rm -rf "$BUILDDIR"
111111
mkdir "$BUILDDIR" || { echo "Could not create build directory." ; exit 1 ; }
112-
( cd "$BUILDDIR" && cmake .. ) || { echo "Could not run cmake in $BUILDDIR ." ; exit 1 ; }
112+
( cd "$BUILDDIR" && cmake -GNinja .. ) || { echo "Could not run cmake in $BUILDDIR ." ; exit 1 ; }
113113
fi
114114

115115
### Get version number for this release
116116
#
117117
#
118-
V=$( cd "$BUILDDIR" && make show-version | grep ^CALAMARES_VERSION | sed s/^[A-Z_]*=// )
118+
V=$( cd "$BUILDDIR" && ninja show-version | grep ^CALAMARES_VERSION | sed s/^[A-Z_]*=// )
119119
test -n "$V" || { echo "Could not obtain version in $BUILDDIR ." ; exit 1 ; }
120120

121121
### Create signed tag
@@ -142,7 +142,7 @@ TMPDIR=$(mktemp -d --suffix="-calamares-$D")
142142
test -d "$TMPDIR" || { echo "Could not create tarball-build directory." ; exit 1 ; }
143143
tar xzf "$TAR_FILE" -C "$TMPDIR" || { echo "Could not unpack tarball." ; exit 1 ; }
144144
test -d "$TMPDIR/$TAR_V" || { echo "Tarball did not contain source directory." ; exit 1 ; }
145-
( cd "$TMPDIR/$TAR_V" && cmake . && make -j4 && make test ) || { echo "Tarball build failed in $TMPDIR ." ; exit 1 ; }
145+
( cd "$TMPDIR/$TAR_V" && cmake -GNinja . && ninja -j4 && ninja test ) || { echo "Tarball build failed in $TMPDIR ." ; exit 1 ; }
146146

147147
### Cleanup
148148
#

ci/travis-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ CMAKE_ARGS="\
1111
-DCMAKE_BUILD_TYPE=Release \
1212
-DWEBVIEW_FORCE_WEBKIT=1 \
1313
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
14-
-DWITH_PYTHONQT=OFF"
14+
-DWITH_PYTHONQT=OFF -GNinja"
1515

1616
export CMAKE_ARGS

ci/travis-continuous.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ df -h
2626
section "cmake $CMAKE_ARGS $SRCDIR"
2727
cmake $CMAKE_ARGS $SRCDIR || { echo "! CMake failed" ; exit 1 ; }
2828

29-
section "make"
30-
make -j2 VERBOSE=1 || { echo "! Make recheck" ; pwd -P ; df -h ; make -j1 VERBOSE=1 ; echo "! Make failed" ; exit 1 ; }
29+
section "ninja"
30+
ninja -j2 VERBOSE=1 || { echo "! Ninja recheck" ; pwd -P ; df -h ; ninja -j1 VERBOSE=1 ; echo "! Ninja failed" ; exit 1 ; }
3131

32-
section "make install"
32+
section "ninja install"
3333

3434
install_debugging() {
3535
ls -la $( find "$1" -type f -name '*.so' )
@@ -42,7 +42,7 @@ echo "# Install"
4242
DESTDIR=/build/INSTALL_ROOT
4343
mkdir -p "$DESTDIR"
4444

45-
if make install VERBOSE=1 DESTDIR="$DESTDIR" ;
45+
if DESTDIR="$DESTDIR" ninja install -v ;
4646
then
4747
echo "# .. install OK"
4848
result=true

ci/travis-coverity.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export PATH="$BUILDDIR/coveritytool/bin:$PATH"
2525

2626
echo "# cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS $SRCDIR"
2727
cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS $SRCDIR || exit 1
28-
cov-build --dir cov-int make -j2
28+
cov-build --dir cov-int ninja -j2
2929

3030
tar caf calamares-ci.tar.xz cov-int
3131

0 commit comments

Comments
 (0)