From 2bf77c8c3839b0d3349ba53614591aeaca3e2871 Mon Sep 17 00:00:00 2001 From: Martin Bruse Date: Sat, 18 May 2024 11:49:17 +0200 Subject: [PATCH] Made the CMake build work with older xxd. --- .github/workflows/test.yml | 2 -- cmake/visqol.cmake | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 684d908..3ad4b59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ jobs: steps: - name: Install dependencies run: sudo apt install -y libogg-dev libvorbis-dev libflac-dev cmake ninja-build libasound2-dev libglfw3-dev libopus-dev - - name: Install modern xxd - run: (curl -O http://ftp.us.debian.org/debian/pool/main/v/vim/xxd_9.0.1378-2_amd64.deb && sudo dpkg -i xxd_9.0.1378-2_amd64.deb) - name: Check out code uses: actions/checkout@v3 - name: Configure diff --git a/cmake/visqol.cmake b/cmake/visqol.cmake index c3aee58..f861075 100644 --- a/cmake/visqol.cmake +++ b/cmake/visqol.cmake @@ -23,8 +23,9 @@ target_include_directories(visqol_proto PUBLIC ${visqol_PROTO_DIR}) set(visqol_MODEL_H ${visqol_SOURCE_DIR}/src/include/libsvm_nu_svr_model.h) add_custom_command( OUTPUT ${visqol_MODEL_H} - COMMAND xxd -i -n visqol_model_bytes ${visqol_SOURCE_DIR}/model/libsvm_nu_svr_model.txt ${visqol_MODEL_H} + COMMAND sh -c "xxd -i ${visqol_SOURCE_DIR}/model/libsvm_nu_svr_model.txt | sed 's/\\w*libsvm_nu_svr_model_txt/visqol_model_bytes/' > ${visqol_MODEL_H}" DEPENDS ${visqol_SOURCE_DIR}/model/libsvm_nu_svr_model.txt + VERBATIM ) add_custom_target(visqol_model DEPENDS ${visqol_MODEL_H})