Enabled unity build by default

This commit is contained in:
emeric
2025-04-20 15:50:21 +02:00
parent 996a86bd96
commit 09492c3c84
5 changed files with 9 additions and 6 deletions
+2
View File
@@ -6,6 +6,7 @@ jobs:
matrix: matrix:
LMS_BUILD_TYPE: [Release, Debug] LMS_BUILD_TYPE: [Release, Debug]
LMS_UNITY_BUILD: [ON, OFF] LMS_UNITY_BUILD: [ON, OFF]
LMS_IMAGE_BACKEND: [stb, graphicsmagick]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check Out Repo - name: Check Out Repo
@@ -32,6 +33,7 @@ jobs:
build-args: | build-args: |
LMS_BUILD_TYPE=${{ matrix.LMS_BUILD_TYPE }} LMS_BUILD_TYPE=${{ matrix.LMS_BUILD_TYPE }}
LMS_UNITY_BUILD=${{ matrix.LMS_UNITY_BUILD }} LMS_UNITY_BUILD=${{ matrix.LMS_UNITY_BUILD }}
LMS_IMAGE_BACKEND=${{ matrix.LMS_IMAGE_BACKEND }}
push: false push: false
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache
+1 -1
View File
@@ -37,7 +37,7 @@ ARG LMS_BUILD_TYPE="Release"
RUN \ RUN \
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \ DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
xx-info is-cross && export BUILD_TESTS=OFF || export BUILD_TESTS=ON && \ xx-info is-cross && export BUILD_TESTS=OFF || export BUILD_TESTS=ON && \
PKG_CONFIG_PATH=/$(xx-info)/usr/lib/pkgconfig cmake /tmp/lms/ -DCMAKE_INCLUDE_PATH=/$(xx-info)/usr/include -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} $(xx-clang --print-cmake-defines) -DCMAKE_PREFIX_PATH=/$(xx-info)/usr/lib/cmake -DBUILD_TESTING=${BUILD_TESTS} -DBUILD_BENCHMARKS=ON && \ PKG_CONFIG_PATH=/$(xx-info)/usr/lib/pkgconfig cmake /tmp/lms/ -DCMAKE_INCLUDE_PATH=/$(xx-info)/usr/include -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} $(xx-clang --print-cmake-defines) -DCMAKE_PREFIX_PATH=/$(xx-info)/usr/lib/cmake -DBUILD_TESTING=${BUILD_TESTS} -DBUILD_BENCHMARKS=ON && \
VERBOSE=1 make -j$(nproc) && \ VERBOSE=1 make -j$(nproc) && \
xx-verify src/lms/lms && \ xx-verify src/lms/lms && \
(xx-info is-cross || make test) (xx-info is-cross || make test)
+3 -1
View File
@@ -12,6 +12,7 @@ ARG BUILD_PACKAGES="\
libconfig \ libconfig \
make \ make \
pkgconfig \ pkgconfig \
stb \
taglib \ taglib \
wt \ wt \
xxhash" xxhash"
@@ -27,6 +28,7 @@ WORKDIR /tmp/lms/build
ARG LMS_BUILD_TYPE=Release ARG LMS_BUILD_TYPE=Release
ARG LMS_UNITY_BUILD=ON ARG LMS_UNITY_BUILD=ON
RUN cmake .. -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} -DCMAKE_UNITY_BUILD=${LMS_UNITY_BUILD} -DLMS_IMAGE_BACKEND=graphicsmagick -DBUILD_BENCHMARKS=ON ARG LMS_IMAGE_BACKEND=stb
RUN cmake .. -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} -DCMAKE_UNITY_BUILD=${LMS_UNITY_BUILD} -DLMS_IMAGE_BACKEND=${LMS_IMAGE_BACKEND} -DBUILD_BENCHMARKS=ON
RUN VERBOSE=1 make -j$(nproc) RUN VERBOSE=1 make -j$(nproc)
RUN make test RUN make test
+1 -1
View File
@@ -116,7 +116,7 @@ RUN \
COPY . /tmp/lms/ COPY . /tmp/lms/
RUN \ RUN \
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \ DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig CXXFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib -Wl,--rpath-link=${PREFIX}/lib" cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} && \ PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig CXXFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib -Wl,--rpath-link=${PREFIX}/lib" cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} && \
LD_LIBRARY_PATH=${PREFIX}/lib make -j$(nproc) install && \ LD_LIBRARY_PATH=${PREFIX}/lib make -j$(nproc) install && \
LD_LIBRARY_PATH=${PREFIX}/lib make test && \ LD_LIBRARY_PATH=${PREFIX}/lib make test && \
mkdir -p ${PREFIX}/etc/ && \ mkdir -p ${PREFIX}/etc/ && \
+2 -3
View File
@@ -51,15 +51,14 @@ git clone https://github.com/epoupon/lms.git lms
cd lms cd lms
mkdir build mkdir build
cd build cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_INSTALL_PREFIX=/usr
``` ```
__Notes__: __Notes__:
* you can customize the installation directory using `-DCMAKE_INSTALL_PREFIX=path` (defaults to `/usr/local`). * you can customize the installation directory using `-DCMAKE_INSTALL_PREFIX=path` (defaults to `/usr/local`).
* you can customize the image library using `-DLMS_IMAGE_BACKEND=<stb|graphicsmagick>` (defaults to `stb`) * you can customize the image library using `-DLMS_IMAGE_BACKEND=<stb|graphicsmagick>` (defaults to `stb`)
```sh ```sh
make make -j$(nproc)
``` ```
__Note__: you can use `make -jN` to speed up compilation time (N is the number of compilation workers to spawn).
### Installation ### Installation
__Note__: the commands of this section require root privileges. __Note__: the commands of this section require root privileges.
```sh ```sh