diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8615e55..a7db6ac 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,7 +48,7 @@ jobs: uses: docker/build-push-action@v6 with: labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64, linux/arm, linux/arm64 + platforms: linux/amd64, linux/arm/v7, linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} target: run diff --git a/CMakeLists.txt b/CMakeLists.txt index 96b812f..69642d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ set(LMZ_COMPILE_FEATURES cxx_std_20) set(LMZ_COMPILE_OPTIONS -O3 -Wall -Wextra) find_package(PkgConfig REQUIRED) -find_package(RpiRgbLedMatrix REQUIRED) pkg_check_modules(ZMQ REQUIRED libzmq) include(FetchContent) @@ -24,19 +23,26 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(argparse plog) -add_executable(led-matrix-zmq-server - src/server_main.cpp - src/color_temp.cpp +if( + CMAKE_SYSTEM_PROCESSOR MATCHES "arm" + OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" ) -target_link_libraries(led-matrix-zmq-server PRIVATE - argparse - plog - pthread - RpiRgbLedMatrix::RpiRgbLedMatrix - zmq -) -target_compile_features(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_FEATURES}) -target_compile_options(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_OPTIONS}) + find_package(RpiRgbLedMatrix REQUIRED) + + add_executable(led-matrix-zmq-server + src/server_main.cpp + src/color_temp.cpp + ) + target_link_libraries(led-matrix-zmq-server PRIVATE + argparse + plog + pthread + RpiRgbLedMatrix::RpiRgbLedMatrix + zmq + ) + target_compile_features(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_FEATURES}) + target_compile_options(led-matrix-zmq-server PRIVATE ${LMZ_COMPILE_OPTIONS}) +endif() add_executable(led-matrix-zmq-control src/control_main.cpp diff --git a/Dockerfile b/Dockerfile index 4c3547b..de5ca3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM alpine:latest as build RUN apk add --no-cache --virtual .build-deps-base \ - clang \ - cmake \ - cppzmq \ - git \ - make \ - pkgconf + clang \ + cmake \ + cppzmq \ + git \ + make \ + pkgconf ENV CC=clang ENV CXX=clang++ @@ -20,30 +20,28 @@ WORKDIR /build RUN git clone --depth 1 https://github.com/Knifa/rpi-rgb-led-matrix.git WORKDIR /build/rpi-rgb-led-matrix RUN cd lib \ - && make + && make RUN mkdir -p /build/led-matrix-zmq-server WORKDIR /build/led-matrix-zmq-server ADD . . RUN mkdir -p build \ - && cd build \ - && cmake -DRPI_RGB_LED_MATRIX_DIR=/build/rpi-rgb-led-matrix .. \ - && make + && cd build \ + && cmake -DRPI_RGB_LED_MATRIX_DIR=/build/rpi-rgb-led-matrix .. \ + && make FROM alpine:latest as run RUN apk add --no-cache \ - libc++ \ - libzmq + libc++ \ + libzmq RUN mkdir -p /opt/led-matrix-zmq-server WORKDIR /opt/led-matrix-zmq-server COPY --from=build \ - /build/led-matrix-zmq-server/build/led-matrix-zmq-server \ - /build/led-matrix-zmq-server/build/led-matrix-zmq-control \ - /build/led-matrix-zmq-server/build/led-matrix-zmq-pipe \ - ./ + /build/led-matrix-zmq-server/build/led-matrix-zmq-* \ + ./ ENV PATH="/opt/led-matrix-zmq-server:$PATH" -CMD ["./led-matrix-zmq-server"] +CMD ["echo", "Please run a specific led-matrix-zmq binary!"]