@@ -3,7 +3,8 @@ name: GitHub Builds
33on : [push, pull_request]
44
55env :
6- NIX_COMPILE_FLAGS : -Wall -Wextra -pedantic -Werror
6+ NIX_COMPILE_FLAGS : -Wall -Wextra -pedantic -Werror
7+ GNU_COMPILE_FLAGS : -Wall -Wextra -pedantic -Werror -Wformat-signedness
78 MSVC_COMPILE_FLAGS : /W4 /WX
89
910jobs :
@@ -112,8 +113,8 @@ jobs:
112113 - name : Configure CMake
113114 run : |
114115 rm -rf build install
115- cmake -B build/shared -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/shared -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
116- cmake -B build/static -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/static -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
116+ cmake -B build/shared -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/shared -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
117+ cmake -B build/static -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/static -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
117118 - name : Build CMake Shared
118119 working-directory : build/shared
119120 run : make install
@@ -139,7 +140,7 @@ jobs:
139140 -S hidapisrc/hidtest \
140141 -Dhidapi_ROOT=install/shared \
141142 -DCMAKE_INSTALL_PREFIX=install/shared_test \
142- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
143+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
143144 cd build/shared_test
144145 make install
145146 - name : Check CMake Export Package Static
@@ -149,7 +150,7 @@ jobs:
149150 -S hidapisrc/hidtest \
150151 -Dhidapi_ROOT=install/static \
151152 -DCMAKE_INSTALL_PREFIX=install/static_test \
152- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
153+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
153154 cd build/static_test
154155 make install
155156
@@ -282,7 +283,7 @@ jobs:
282283 - name : Configure CMake MinGW
283284 shell : cmd
284285 run : |
285- cmake -G"MinGW Makefiles" -B build\mingw -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DCMAKE_INSTALL_PREFIX=install\mingw -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS %"
286+ cmake -G"MinGW Makefiles" -B build\mingw -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DCMAKE_INSTALL_PREFIX=install\mingw -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%GNU_COMPILE_FLAGS %"
286287 - name : Build CMake MinGW
287288 working-directory : build\mingw
288289 run : cmake --build . --target install
@@ -303,7 +304,7 @@ jobs:
303304 -S hidapisrc\hidtest ^
304305 -Dhidapi_ROOT=install\mingw ^
305306 -DCMAKE_INSTALL_PREFIX=install\mingw_test ^
306- "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS %"
307+ "-DCMAKE_C_FLAGS=%GNU_COMPILE_FLAGS %"
307308 cd build\mingw_test
308309 cmake --build . --target install
309310 - name : Run CTest MinGW
@@ -370,8 +371,8 @@ jobs:
370371 - name : Configure CMake
371372 run : |
372373 rm -rf build install
373- mingw64-cmake -B build/shared-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
374- mingw64-cmake -B build/static-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
374+ mingw64-cmake -B build/shared-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
375+ mingw64-cmake -B build/static-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
375376 - name : Configure Automake
376377 working-directory : hidapisrc
377378 run : |
@@ -411,7 +412,7 @@ jobs:
411412 -S hidapisrc/hidtest \
412413 -Dhidapi_DIR=$PWD/install/shared-cmake/lib/cmake/hidapi \
413414 -DCMAKE_INSTALL_PREFIX=install/shared_test \
414- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
415+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
415416 cd build/shared_test
416417 ninja install
417418 - name : Check CMake Export Package Static
@@ -422,7 +423,7 @@ jobs:
422423 -S hidapisrc/hidtest \
423424 -Dhidapi_DIR=$PWD/install/static-cmake/lib/cmake/hidapi \
424425 -DCMAKE_INSTALL_PREFIX=install/static_test \
425- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
426+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
426427 cd build/static_test
427428 ninja install
428429
@@ -442,8 +443,8 @@ jobs:
442443 - name : Configure CMake
443444 run : |
444445 rm -rf build install
445- cmake -B build/shared-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
446- cmake -B build/static-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
446+ cmake -B build/shared-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
447+ cmake -B build/static-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
447448 - name : Configure Automake
448449 working-directory : hidapisrc
449450 run : |
@@ -486,7 +487,7 @@ jobs:
486487 -S hidapisrc/hidtest \
487488 -Dhidapi_ROOT=install/shared-cmake \
488489 -DCMAKE_INSTALL_PREFIX=install/shared_test \
489- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
490+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
490491 cd build/shared_test
491492 make install
492493 - name : Check CMake Export Package Static
@@ -496,7 +497,7 @@ jobs:
496497 -S hidapisrc/hidtest \
497498 -Dhidapi_ROOT=install/static-cmake \
498499 -DCMAKE_INSTALL_PREFIX=install/static_test \
499- "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS }"
500+ "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS }"
500501 cd build/static_test
501502 make install
502503
@@ -507,7 +508,7 @@ jobs:
507508 container : alpine:edge
508509 env :
509510 # A bug in musl: https://www.openwall.com/lists/musl/2020/01/20/2
510- ALPINE_COMPILE_FLAGS : ${NIX_COMPILE_FLAGS } -Wno-overflow
511+ ALPINE_COMPILE_FLAGS : ${GNU_COMPILE_FLAGS } -Wno-overflow
511512 steps :
512513 - uses : actions/checkout@v3
513514 with :
0 commit comments