Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/libdof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
fail-fast: false
matrix:
include:
- { os: windows-2025, platform: win, arch: x64 }
- { os: windows-2025, platform: win, arch: x86 }
- { os: windows-2025-vs2026, platform: win, arch: x64 }
- { os: windows-2025-vs2026, platform: win, arch: x86 }
- { os: windows-2025, platform: win-mingw, arch: x64 }
- { os: macos-15, platform: macos, arch: arm64 }
- { os: macos-15, platform: macos, arch: x64 }
Expand All @@ -59,13 +59,13 @@ jobs:
run: |
if [[ "${{ matrix.arch }}" == "x64" ]]; then
/c/msys64/usr/bin/bash.exe -l -c "pacman -S --noconfirm \
make diffutils \
make diffutils autoconf automake libtool \
mingw-w64-ucrt-x86_64-gcc \
mingw-w64-ucrt-x86_64-libwinpthread \
mingw-w64-ucrt-x86_64-cmake"
else
/c/msys64/usr/bin/bash.exe -l -c "pacman -S --noconfirm \
make diffutils \
make diffutils autoconf automake libtool \
mingw-w64-i686-gcc \
mingw-w64-i686-libwinpthread \
mingw-w64-i686-cmake"
Expand All @@ -92,13 +92,13 @@ jobs:
./platforms/${{ matrix.platform }}/${{ matrix.arch }}/external.sh
if [[ "${{ matrix.arch }}" == "x64" ]]; then
cmake \
-G "Visual Studio 17 2022" \
-G "Visual Studio 18 2026" \
-DPLATFORM=${{ matrix.platform }} \
-DARCH=${{ matrix.arch }} \
-B build
else
cmake \
-G "Visual Studio 17 2022" \
-G "Visual Studio 18 2026" \
-A Win32 \
-DPLATFORM=${{ matrix.platform }} \
-DARCH=${{ matrix.arch }} \
Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ if(BUILD_SHARED)
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb64-1.0.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb64-1.0.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport64.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64-0.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/hidapi64.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/hidapi64.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libftdi164.lib" "$<TARGET_FILE_DIR:dof_test>"
Expand All @@ -377,11 +377,14 @@ if(BUILD_SHARED)
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb-1.0.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb-1.0.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport-0.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/hidapi.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/hidapi.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libftdi1.lib" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libftdi1.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libgcc_s_dw2-1.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libstdc++-6.dll" "$<TARGET_FILE_DIR:dof_test>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libwinpthread-1.dll" "$<TARGET_FILE_DIR:dof_test>"
)
endif()
elseif(PLATFORM STREQUAL "win-mingw")
Expand Down Expand Up @@ -470,7 +473,7 @@ if(BUILD_STATIC)
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb64-1.0.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb64-1.0.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport64.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64-0.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/hidapi64.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/hidapi64.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libftdi164.lib" "$<TARGET_FILE_DIR:dof_test_s>"
Expand All @@ -484,11 +487,14 @@ if(BUILD_STATIC)
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb-1.0.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb-1.0.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport-0.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/hidapi.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/hidapi.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libftdi1.lib" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libftdi1.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libgcc_s_dw2-1.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libstdc++-6.dll" "$<TARGET_FILE_DIR:dof_test_s>"
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libwinpthread-1.dll" "$<TARGET_FILE_DIR:dof_test_s>"
)
endif()
elseif(PLATFORM STREQUAL "win-mingw")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pacman -S --noconfirm make diffutils \

```shell
platforms/win/x64/external.sh
cmake -G "Visual Studio 17 2022" -DPLATFORM=win -DARCH=x64 -B build
cmake -G "Visual Studio 18 2026" -DPLATFORM=win -DARCH=x64 -B build
cmake --build build --config Release
```

Expand All @@ -119,7 +119,7 @@ pacman -S --noconfirm make diffutils \

```shell
platforms/win/x86/external.sh
cmake -G "Visual Studio 17 2022" -A Win32 -DPLATFORM=win -DARCH=x86 -B build
cmake -G "Visual Studio 18 2026" -A Win32 -DPLATFORM=win -DARCH=x86 -B build
cmake --build build --config Release
```

Expand Down
67 changes: 40 additions & 27 deletions platforms/win/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ curl -sL https://github.com/libusb/libusb/archive/${LIBUSB_SHA}.tar.gz -o libusb
tar xzf libusb-${LIBUSB_SHA}.tar.gz
mv libusb-${LIBUSB_SHA} libusb
cd libusb
sed -i.bak 's/LIBRARY.*libusb-1.0/LIBRARY libusb64-1.0/' libusb/libusb-1.0.def
# remove patch after this is fixed: https://github.com/libusb/libusb/issues/1649#issuecomment-2940138443
cp ../../platforms/win/x64/libusb/libusb_dll.vcxproj msvc
msbuild.exe msvc/libusb_dll.vcxproj \
-p:TargetName=libusb64-1.0 \
-p:Platform=x64 \
-p:Configuration=Release
sed -i.bak 's/libusb-1\.0/libusb64-1.0/g' libusb/Makefile.am
sed -i.bak 's/libusb_1_0/libusb64_1_0/g' libusb/Makefile.am
mv libusb/libusb-1.0.def libusb/libusb64-1.0.def
mv libusb/libusb-1.0.rc libusb/libusb64-1.0.rc
sed -i.bak 's/libusb-1\.0/libusb64-1.0/g' libusb/libusb64-1.0.def
sed -i.bak 's/libusb-1\.0/libusb64-1.0/g' libusb/libusb64-1.0.rc
CURRENT_DIR="$(pwd)"
MSYSTEM=UCRT64 "${MSYS2_PATH}/usr/bin/bash.exe" -l -c "
cd \"${CURRENT_DIR}\" &&
./autogen.sh &&
./configure --enable-shared &&
make -j\$(nproc)
"
mkdir -p ../../third-party/include/libusb-1.0
cp libusb/libusb.h ../../third-party/include/libusb-1.0
cp build/v143/x64/Release/libusb_dll/../dll/libusb64-1.0.lib ../../third-party/build-libs/win/x64
cp build/v143/x64/Release/libusb_dll/../dll/libusb64-1.0.dll ../../third-party/runtime-libs/win/x64
cp libusb/.libs/libusb64-1.0.dll.a ../../third-party/build-libs/win/x64/libusb64-1.0.lib
cp libusb/.libs/libusb64-1.0.dll ../../third-party/runtime-libs/win/x64/
cd ..

#
Expand All @@ -52,31 +58,38 @@ tar xzf libserialport-${LIBSERIALPORT_SHA}.tar.gz
mv libserialport-${LIBSERIALPORT_SHA} libserialport
cd libserialport
cp libserialport.h ../../third-party/include
msbuild.exe libserialport.sln \
-p:PlatformToolset=v143 \
-p:TargetName=libserialport64 \
-p:Platform=x64 \
-p:Configuration=Release
cp x64/Release/libserialport64.lib ../../third-party/build-libs/win/x64
cp x64/Release/libserialport64.dll ../../third-party/runtime-libs/win/x64
sed -i.bak 's/libserialport\.la/libserialport64.la/g; s/libserialport_la/libserialport64_la/g' Makefile.am
CURRENT_DIR="$(pwd)"
MSYSTEM=UCRT64 "${MSYS2_PATH}/usr/bin/bash.exe" -l -c "
cd \"${CURRENT_DIR}\" &&
./autogen.sh &&
./configure &&
make -j\$(nproc)
"
cp .libs/libserialport64.dll.a ../../third-party/build-libs/win/x64/libserialport64.lib
cp .libs/libserialport64-0.dll ../../third-party/runtime-libs/win/x64/
cd ..

#
# build hdiapi and copy to third-party
# build hidapi and copy to third-party
#

curl -sL https://github.com/libusb/hidapi/archive/${HIDAPI_SHA}.tar.gz -o hidapi-${HIDAPI_SHA}.tar.gz
tar xzf hidapi-${HIDAPI_SHA}.tar.gz
mv hidapi-${HIDAPI_SHA} hidapi
cd hidapi
sed -i.bak 's/OUTPUT_NAME "hidapi"/OUTPUT_NAME "hidapi64"/' windows/CMakeLists.txt
cmake \
-G "Visual Studio 17 2022" \
-B build
cmake --build build --config ${BUILD_TYPE}
sed -i.bak 's/OUTPUT_NAME "hidapi"/OUTPUT_NAME "hidapi64"\n PREFIX ""\n IMPORT_PREFIX ""/' windows/CMakeLists.txt
CURRENT_DIR="$(pwd)"
MSYSTEM=UCRT64 "${MSYS2_PATH}/usr/bin/bash.exe" -l -c "
cd \"${CURRENT_DIR}\" &&
cmake \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-B build &&
cmake --build build -- -j\$(nproc)
"
cp -r hidapi ../../third-party/include/
cp build/src/windows/${BUILD_TYPE}/hidapi64.lib ../../third-party/build-libs/win/x64/
cp build/src/windows/${BUILD_TYPE}/hidapi64.dll ../../third-party/runtime-libs/win/x64/
cp build/src/windows/hidapi64.dll.a ../../third-party/build-libs/win/x64/hidapi64.lib
cp build/src/windows/hidapi64.dll ../../third-party/runtime-libs/win/x64/
cd ..

#
Expand All @@ -97,10 +110,10 @@ MSYSTEM=UCRT64 "${MSYS2_PATH}/usr/bin/bash.exe" -l -c "
-DEXAMPLES=OFF \
-DSTATICLIBS=OFF \
-DLIBUSB_INCLUDE_DIR=../libusb/libusb \
-DLIBUSB_LIBRARIES=$(pwd)/../libusb/build/v143/x64/Release/libusb_dll/../dll/libusb64-1.0.dll \
-DLIBUSB_LIBRARIES=$(pwd)/../../third-party/runtime-libs/win/x64/libusb64-1.0.dll \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-B build &&
cmake --build build -- -j$(nproc)
cmake --build build -- -j\$(nproc)
"

mkdir -p ../../third-party/include/libftdi1
Expand All @@ -110,7 +123,7 @@ cp build/src/libftdi164.dll ../../third-party/runtime-libs/win/x64/
cd ..

#
# copy UCRT64 runtime DLLs (needed by MinGW-built libftdi164.dll)
# copy UCRT64 runtime DLLs (needed by MinGW-built DLLs)
#

UCRT64_BIN="${MSYS2_PATH}/ucrt64/bin"
Expand Down
66 changes: 0 additions & 66 deletions platforms/win/x64/libusb/libusb_dll.vcxproj

This file was deleted.

Loading
Loading