Skip to content

Commit e4e871c

Browse files
Validate CMake integration
Closes #538
1 parent 49be336 commit e4e871c

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/cmake-test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.19)
2+
project(test VERSION 0.0.1)
3+
4+
find_package(xsimd REQUIRED)
5+
6+
add_executable(test main.cpp)
7+
target_link_libraries(test PUBLIC xsimd)

.github/cmake-test/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "xsimd/xsimd.hpp"
2+
3+
int main()
4+
{
5+
return 0;
6+
}

.github/workflows/cmake.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CMake integration
2+
on: [push, pull_request]
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
defaults:
7+
run:
8+
shell: bash -l {0}
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Checkout xsimd
14+
uses: actions/checkout@v3
15+
- name: Configure build
16+
run: |
17+
mkdir _build && cd _build
18+
cmake .. -DCMAKE_BUILD_TYPE=Release \
19+
-DCMAKE_INSTALL_PREFIX=_install
20+
- name: Build
21+
run: cmake --build _build --target install
22+
- name: Check install
23+
run: |
24+
mkdir _install_build && cd _install_build
25+
cp ${{ github.workspace }}/.github/cmake-test/* .
26+
ls $PWD/../_build/_install/share/cmake/xsimd
27+
cmake . -DCMAKE_PREFIX_PATH=$PWD/../_build/_install/share/cmake/xsimd
28+
cmake --build .
29+

0 commit comments

Comments
 (0)