@@ -95,72 +95,99 @@ jobs:
9595 install/static/include/hidapi/hidapi_libusb.h"
9696 allow_failure : true
9797
98- windows-cmake-msvc :
98+ windows-cmake :
9999
100100 runs-on : windows-latest
101101
102102 steps :
103103 - uses : actions/checkout@v2
104104 with :
105105 path : hidapisrc
106- - name : Configure CMake
106+ - name : Configure CMake MSVC
107107 shell : cmd
108108 run : |
109- RMDIR /Q /S build install
110- cmake -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
111- - name : Build CMake
112- working-directory : build
109+ cmake -B build\msvc -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\msvc -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
110+ - name : Build CMake MSVC
111+ working-directory : build/msvc
113112 run : cmake --build . --target install
114- - name : Check artifacts
113+ - name : Check artifacts MSVC
115114 uses : andstor/file-existence-action@v1
116115 with :
117- files : " install/lib/hidapi.lib, install/bin/hidapi.dll, install/include/hidapi/hidapi.h, install/include/hidapi/hidapi_winapi.h"
116+ files : " install/msvc/lib/hidapi.lib, \
117+ install/msvc/bin/hidapi.dll, \
118+ install/msvc/include/hidapi/hidapi.h, \
119+ install/msvc/include/hidapi/hidapi_winapi.h"
118120 allow_failure : true
119121
120- windows-cmake-nmake :
121-
122- runs-on : windows-latest
123-
124- steps :
125- - uses : actions/checkout@v2
126- with :
127- path : hidapisrc
128- - name : Configure CMake
122+ - name : Configure CMake NMake
129123 shell : cmd
130124 run : |
131- RMDIR /Q /S build install
132125 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
133- cmake -G"NMake Makefiles" -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
134- - name : Build CMake
135- working-directory : build
126+ cmake -G"NMake Makefiles" -B build\nmake -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\nmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
127+ - name : Build CMake NMake
128+ working-directory : build\nmake
136129 shell : cmd
137130 run : |
138131 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
139132 nmake install
140- - name : Check artifacts
133+ - name : Check artifacts NMake
134+ uses : andstor/file-existence-action@v1
135+ with :
136+ files : " install/nmake/lib/hidapi.lib, \
137+ install/nmake/bin/hidapi.dll, \
138+ install/nmake/include/hidapi/hidapi.h, \
139+ install/nmake/include/hidapi/hidapi_winapi.h"
140+ allow_failure : true
141+
142+ - name : Configure CMake MinGW
143+ shell : cmd
144+ run : |
145+ cmake -G"MinGW Makefiles" -B build\mingw -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\mingw -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS%"
146+ - name : Build CMake MinGW
147+ working-directory : build\mingw
148+ run : cmake --build . --target install
149+ - name : Check artifacts MinGW
141150 uses : andstor/file-existence-action@v1
142151 with :
143- files : " install/lib/hidapi.lib, install/bin/hidapi.dll, install/include/hidapi/hidapi.h, install/include/hidapi/hidapi_winapi.h"
152+ files : " install/mingw/lib/libhidapi.dll.a, \
153+ install/mingw/bin/libhidapi.dll, \
154+ install/mingw/include/hidapi/hidapi.h, \
155+ install/mingw/include/hidapi/hidapi_winapi.h"
144156 allow_failure : true
145157
146- windows-cmake-mingw :
158+ windows-msbuild :
147159
148160 runs-on : windows-latest
149161
150162 steps :
151163 - uses : actions/checkout@v2
164+ - uses : microsoft/setup-msbuild@v1.1
165+ - name : MSBuild x86
166+ run : msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=Win32
167+ - name : Check artifacts x86
168+ uses : andstor/file-existence-action@v1
152169 with :
153- path : hidapisrc
154- - name : Configure CMake
155- shell : cmd
156- run : |
157- RMDIR /Q /S build install
158- cmake -G"MinGW Makefiles" -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS%"
159- - name : Build CMake
160- working-directory : build
161- run : cmake --build . --target install
162- - name : Check artifacts
170+ files : " windows/Release/hidapi.dll, windows/Release/hidapi.lib, windows/Release/hidapi.pdb"
171+ allow_failure : true
172+ - name : MSBuild x64
173+ run : msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=x64
174+ - name : Check artifacts x64
163175 uses : andstor/file-existence-action@v1
164176 with :
165- files : " install/lib/libhidapi.dll.a, install/bin/libhidapi .dll, install/include/hidapi /hidapi.h, install/include/hidapi/hidapi_winapi.h "
177+ files : " windows/x64/Release/hidapi .dll, windows/x64/Release /hidapi.lib, windows/x64/Release/hidapi.pdb "
166178 allow_failure : true
179+ - name : Gather artifacts
180+ run : |
181+ md artifacts
182+ md artifacts\x86
183+ md artifacts\x64
184+ md artifacts\include
185+ Copy-Item "windows\Release\hidapi.dll","windows\Release\hidapi.lib","windows\Release\hidapi.pdb" -Destination "artifacts\x86"
186+ Copy-Item "windows\x64\Release\hidapi.dll","windows\x64\Release\hidapi.lib","windows\x64\Release\hidapi.pdb" -Destination "artifacts\x64"
187+ Copy-Item "hidapi\hidapi.h","windows\hidapi_winapi.h" -Destination "artifacts\include"
188+ - name : Upload artifacts
189+ uses : actions/upload-artifact@v3
190+ with :
191+ name : hidapi-win
192+ path : artifacts/
193+ retention-days : ${{ (github.event_name == 'pull_request' || github.ref_name != 'master') && 7 || 90 }}
0 commit comments