From f2c45c806d270d8961ffb24552b01f490e78aea7 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Mon, 14 Oct 2024 17:40:17 +0200 Subject: [PATCH] Validate CMake integration Closes #538 --- .github/cmake-test/CMakeLists.txt | 7 +++++++ .github/cmake-test/main.cpp | 5 +++++ .github/workflows/cmake.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .github/cmake-test/CMakeLists.txt create mode 100644 .github/cmake-test/main.cpp create mode 100644 .github/workflows/cmake.yml diff --git a/.github/cmake-test/CMakeLists.txt b/.github/cmake-test/CMakeLists.txt new file mode 100644 index 000000000..660880dbf --- /dev/null +++ b/.github/cmake-test/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.19) +project(test VERSION 0.0.1) + +find_package(xsimd REQUIRED) + +add_executable(test main.cpp) +target_link_libraries(test PUBLIC xsimd) diff --git a/.github/cmake-test/main.cpp b/.github/cmake-test/main.cpp new file mode 100644 index 000000000..2327656de --- /dev/null +++ b/.github/cmake-test/main.cpp @@ -0,0 +1,5 @@ +#include "xsimd/xsimd.hpp" + +int main() { + return 0; +} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 000000000..43317930b --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,27 @@ +name: CMake integration +on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -l {0} +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout xsimd + uses: actions/checkout@v3 + - name: Configure build + run: | + mkdir _build && cd _build + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=_install + - name: Build + run: cmake --build _build --target install + - name: Check install + run: | + mkdir _install_build && cd _install_build + cp ${{ github.workspace }}/.github/cmake-test/* . + cmake . -DCMAKE_PREFIX_PATH=../_build/_install/*/cmake/xsimd +