aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/cmake.yml49
-rw-r--r--lib/cleanpath.c11
2 files changed, 55 insertions, 5 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
new file mode 100644
index 0000000..bc094b7
--- /dev/null
+++ b/.github/workflows/cmake.yml
@@ -0,0 +1,49 @@
+name: CMake
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+env:
+ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
+ BUILD_TYPE: Release
+
+jobs:
+ tests:
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: true
+ matrix:
+ include:
+ - name: Debug (Linux)
+ os: ubuntu-latest
+ build_type: Release
+
+ - name: Debug (MacOS)
+ os: macos-latest
+ build_type: Release
+
+ - name: Release (Linux)
+ os: ubuntu-latest
+ build_type: Release
+
+ - name: Release (MacOS)
+ os: macos-latest
+ build_type: Release
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Configure CMake
+ run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+
+ - name: Build
+ run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
+
+ - name: Test
+ working-directory: ${{ github.workspace }}/build
+ run: ctest -C ${{ matrix.build_type }}
+
diff --git a/lib/cleanpath.c b/lib/cleanpath.c
index 55d6c22..f94c66d 100644
--- a/lib/cleanpath.c
+++ b/lib/cleanpath.c
@@ -1,19 +1,20 @@
#include <stdlib.h>
#include <string.h>
-#include <limits.h>
#include <regex.h>
-#include "cleanpath.h"
#include "config.h"
+#include "cleanpath.h"
#if OS_LINUX
-#ifdef HAVE_SYS_LIMIT_H
+#if HAVE_SYS_LIMIT_H
#include <sys/limits.h>
#endif // HAVE_SYS_LIMIT_H
-#ifdef HAVE_LINUX_LIMIT_H
+#if HAVE_LINUX_LIMIT_H
#include <linux/limits.h>
#endif // HAVE_LINUX_LIMIT_H
-#endif // OS_LINUX
+#else
+#include <limits.h>
+#endif
/**
* Split path into parts by sep