Skip to content

Commit 5d295f8

Browse files
committed
Use cmake IPO with 'release' arg
also switch to ninja
1 parent b6a5036 commit 5d295f8

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ RUN make -j`nproc` && make install_sw && rm -rf /build-ssl
6969
############
7070
WORKDIR /build-qt
7171
COPY md5sums-qt.txt build-qt.sh qtbase.patch /build-qt/
72-
RUN PKG_CONFIG_PATH=/openssl/lib64/pkgconfig ./build-qt.sh && mv qt /qt && rm -rf /build-qt
72+
ARG release
73+
# Note: {foo:+bar} here is a syntax of the Dockerfile, not the shell!
74+
ENV IPO_ARG=${release:+-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON}
75+
RUN echo IPO_ARG ${IPO_ARG}
76+
RUN BUILDQT_CMAKE_ARGS=${IPO_ARG} PKG_CONFIG_PATH=/openssl/lib64/pkgconfig ./build-qt.sh && mv qt /qt && rm -rf /build-qt
7377

7478
###############
7579
# Build aria2 #
@@ -88,14 +92,13 @@ COPY . /updater
8892
RUN set -e; for D in . quazip fluid; do cd /updater/$D && git clean -dXff; done
8993
WORKDIR /build
9094
# TODO no-pie?
91-
RUN PKG_CONFIG_PATH=/openssl/lib64/pkgconfig cmake -DCMAKE_FIND_ROOT_PATH=/qt -DCMAKE_BUILD_TYPE=MinSizeRel /updater && make -j`nproc`
95+
RUN PKG_CONFIG_PATH=/openssl/lib64/pkgconfig cmake -G Ninja -DCMAKE_FIND_ROOT_PATH=/qt -DCMAKE_BUILD_TYPE=MinSizeRel ${IPO_ARG} /updater && ninja
9296
RUN mv updater updater-nonstripped && strip updater-nonstripped -o updater
9397
# Version check: do not depend on glibc > 2.31
9498
RUN echo GLIBC_2.31 > target_version && \
9599
grep -aoE 'GLIBC_[0-9.]+' updater > symbol_versions && \
96100
cat target_version symbol_versions | sort -V | tail -1 | tee max_version && \
97101
diff -q target_version max_version
98-
ARG release
99102
RUN if [ -n "$release" ]; then cp updater UnvanquishedUpdater && 7z -tzip -mx=9 a UnvUpdaterLinux.zip UnvanquishedUpdater; fi
100103
ENV zipfile=${release:+UnvUpdaterLinux.zip}
101104
CMD cp updater updater-nonstripped $zipfile /build-docker

build-qt.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env bash
2+
3+
# Usage: [EXTRA_CMAKE_ARGS=<args...>] build-qt.sh [<qt submodule>...]
4+
# installs to ./qt/
5+
26
set -e
37
set -u
48
set -o pipefail
@@ -40,10 +44,11 @@ INSTALL_DIR="${WORK_DIR}/qt"
4044
#FIXME bad warning in qtdeclarative-everywhere-src-6.8.3/src/quickwidgets/qquickwidget.cpp
4145
# TODO: no-pie linux-only
4246

43-
common_options_cmake='
47+
common_options_cmake="
4448
-DFEATURE_accessibility=OFF
4549
-DQT_GENERATE_SBOM=OFF
46-
'
50+
${BUILDQT_CMAKE_ARGS:-}
51+
"
4752
options_qtbase="
4853
-opensource
4954
-confirm-license

0 commit comments

Comments
 (0)