diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4bdd17f..330ee19 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -22,7 +22,7 @@ jobs: build: strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true @@ -51,7 +51,7 @@ jobs: echo "CXX=/usr/bin/g++-12" >> $GITHUB_ENV - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=ON + run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" -DBUILD_TESTING="ON" - name: Build run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j @@ -67,7 +67,7 @@ jobs: needs: build strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true @@ -84,13 +84,13 @@ jobs: working-directory: ${{github.workspace}}/build run: | chmod -R +rx ${{github.workspace}}/build - ctest -C ${{env.BUILD_TYPE}} --output-on-failure + ctest -C ${{env.BUILD_TYPE}} --output-on-failure -E "benchmark" benchmark: needs: build strategy: matrix: - os: [ macos-latest, ubuntu-22.04 ] + os: [ macos-latest, ubuntu-22.04, ubuntu-22.04-arm, windows-latest ] runs-on: ${{ matrix.os }} continue-on-error: true @@ -104,6 +104,7 @@ jobs: path: ${{github.workspace}}/build - name: Benchmark + working-directory: ${{github.workspace}}/build run: | - chmod +x ${{github.workspace}}/build/benchmark/timeq_benchmark - ${{github.workspace}}/build/benchmark/timeq_benchmark + chmod -R +rx ${{github.workspace}}/build + ctest -C ${{env.BUILD_TYPE}} -R "benchmark" --verbose diff --git a/README.md b/README.md index 1c227ec..d510cec 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ intervals have elapsed since the last update. ## Requirements - CMake 3.13 or newer -- A C++20 compiler (GCC, Clang, or Apple Clang) +- A C++20 compiler When built as the top-level project, test and benchmark dependencies (GoogleTest and Google Benchmark) are fetched automatically via [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake). diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index aabfddc..894306b 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -22,3 +22,5 @@ target_compile_options(timeq_benchmark PRIVATE ) target_link_libraries(timeq_benchmark PRIVATE timeq benchmark::benchmark_main) + +add_test(NAME timeq_benchmark COMMAND timeq_benchmark) diff --git a/include/timeq/fast_time_queue.h b/include/timeq/fast_time_queue.h index db16db0..6d07c00 100644 --- a/include/timeq/fast_time_queue.h +++ b/include/timeq/fast_time_queue.h @@ -33,7 +33,11 @@ #include namespace timeq { -#define FORCE_INLINE __attribute__((always_inline)) +#ifdef _MSC_VER +#define FORCE_INLINE inline __forceinline +#else +#define FORCE_INLINE inline __attribute__((always_inline)) +#endif /** * @brief Aging element FIFO queue. diff --git a/include/timeq/time_queue.h b/include/timeq/time_queue.h index 045a97c..7c55bf2 100644 --- a/include/timeq/time_queue.h +++ b/include/timeq/time_queue.h @@ -33,7 +33,11 @@ #include namespace timeq { -#define FORCE_INLINE __attribute__((always_inline)) +#ifdef _MSC_VER +#define FORCE_INLINE inline __forceinline +#else +#define FORCE_INLINE inline __attribute__((always_inline)) +#endif /** * @brief Aging element FIFO queue.