diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml new file mode 100644 index 00000000..8c78cfcb --- /dev/null +++ b/.github/workflows/alpine.yml @@ -0,0 +1,27 @@ +name: Alpine Linux +'on': + - push + - pull_request +jobs: + ubuntu-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: start docker + run: | + docker run -w /src -dit --name alpine -v $PWD:/src alpine:latest + echo 'docker exec alpine "$@";' > ./alpine.sh + chmod +x ./alpine.sh + - name: install packages + run: | + ./alpine.sh apk update + ./alpine.sh apk add build-base cmake g++ linux-headers git bash + - name: cmake + run: | + ./alpine.sh cmake -B build_for_alpine + - name: build + run: | + ./alpine.sh cmake --build build_for_alpine + - name: test + run: | + ./alpine.sh bash -c "cd build_for_alpine && ctest" \ No newline at end of file diff --git a/benchmark/linux/linux-perf-events.h b/benchmark/linux/linux-perf-events.h index 1867b273..fe23517c 100644 --- a/benchmark/linux/linux-perf-events.h +++ b/benchmark/linux/linux-perf-events.h @@ -1,8 +1,16 @@ // https://github.com/WojciechMula/toys/blob/master/000helpers/linux-perf-events.h #pragma once #ifdef __linux__ - +#ifdef __has_include +#if __has_include() #include // for __NR_perf_event_open +#else +#warning "Header asm/unistd.h cannot be found though it is a linux system. Are linux headers missing?" +#endif +#else // no __has_include +// Please insure that linux headers have been installed. +#include // for __NR_perf_event_open +#endif #include // for perf event constants #include // for ioctl #include // for syscall