Skip to content

Commit 1cf589c

Browse files
committed
added check for disabling shared lib deps.
1 parent a41ace3 commit 1cf589c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.github/workflows/cppcmake.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
# ARM Linux builds - cross-compiled with QEMU testing (Jetson, Raspberry Pi compatible)
4646
# SHLIBDEPS must be disabled for cross-compiled packages as the host system
4747
# does not have the target architecture libraries installed
48-
- {name: "ubuntu-22.04-arm64", os: "ubuntu-22.04", arch: "aarch64", cross_compile: true, cmake_extra: "-DLSL_BUNDLED_PUGIXML=ON -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=OFF -DCPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS=OFF" }
49-
- {name: "ubuntu-22.04-armhf", os: "ubuntu-22.04", arch: "armv7", cross_compile: true, cmake_extra: "-DLSL_BUNDLED_PUGIXML=ON -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=OFF -DCPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS=OFF" }
48+
- {name: "ubuntu-22.04-arm64", os: "ubuntu-22.04", arch: "aarch64", cross_compile: true, cmake_extra: "-DLSL_BUNDLED_PUGIXML=ON -DLSL_DISABLE_PACKAGE_SHLIBDEPS=ON" }
49+
- {name: "ubuntu-22.04-armhf", os: "ubuntu-22.04", arch: "armv7", cross_compile: true, cmake_extra: "-DLSL_BUNDLED_PUGIXML=ON -DLSL_DISABLE_PACKAGE_SHLIBDEPS=ON" }
5050

5151
# Native ARM build
5252
# - {name: "ubuntu-24.04-arm64-native", os: "ubuntu-24.04-arm", arch: "aarch64", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF" }
@@ -177,13 +177,6 @@ jobs:
177177
- name: Package
178178
run: |
179179
echo "Creating package for ${{ matrix.config.arch }}"
180-
181-
# For cross-compiled builds, explicitly disable shlibdeps before packaging
182-
if [[ "${{ matrix.config.cross_compile }}" == "true" ]]; then
183-
# Reconfigure with SHLIBDEPS explicitly OFF for cross-compilation
184-
cmake -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=OFF -DCPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS=OFF build
185-
fi
186-
187180
cmake --build build --target package --config Release -j
188181
189182
# On Debian / Ubuntu the dependencies can only be resolved for
@@ -195,7 +188,6 @@ jobs:
195188
dpkg -I package/liblsl*.deb
196189
fi
197190
198-
# For cross-compiled ARM packages, add architecture to package metadata
199191
if [[ "${{ matrix.config.cross_compile }}" == "true" ]]; then
200192
echo "Cross-compiled ${{ matrix.config.arch }} package created"
201193
ls -lh package/

cmake/LSLCMake.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ macro(LSLGenerateCPackConfig)
312312
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
313313
set(CPACK_DEB_COMPONENT_INSTALL ON)
314314
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
315-
set(CPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS ON)
315+
# Allow disabling SHLIBDEPS for cross-compilation (dpkg-shlibdeps can't analyze ARM binaries on x86 host)
316+
if(NOT LSL_DISABLE_PACKAGE_SHLIBDEPS)
317+
set(CPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS ON)
318+
endif()
316319
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
317320

318321
# include distribution name (e.g. trusty or xenial) in the file name

0 commit comments

Comments
 (0)