diff --git a/.github/workflows/libdmdutil.yml b/.github/workflows/libdmdutil.yml index a7f34d5..8c4e5b2 100644 --- a/.github/workflows/libdmdutil.yml +++ b/.github/workflows/libdmdutil.yml @@ -46,8 +46,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 } @@ -68,13 +68,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" @@ -104,13 +104,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 }} \ @@ -200,14 +200,24 @@ jobs: run: | mkdir tmp if [[ "${{ matrix.arch }}" == "x64" ]]; then - LIBS=(dmdutil64 cargs64 zedmd64 serum64 libusb64-1.0 libserialport64 sockpp64 pupdmd64 vni64) + LIBS=(dmdutil64 cargs64 zedmd64 serum64 libusb64-1.0 sockpp64 pupdmd64 vni64) else - LIBS=(dmdutil cargs zedmd serum libusb-1.0 libserialport sockpp pupdmd vni) + LIBS=(dmdutil cargs zedmd serum libusb-1.0 sockpp pupdmd vni) fi for LIB in "${LIBS[@]}"; do cp "build/Release/${LIB}.lib" tmp cp "build/Release/${LIB}.dll" tmp done + if [[ "${{ matrix.arch }}" == "x64" ]]; then + cp build/Release/libserialport64.lib tmp + cp build/Release/libserialport64-0.dll tmp + else + cp build/Release/libserialport.lib tmp + cp build/Release/libserialport-0.dll tmp + fi + cp build/Release/libgcc_s_*.dll tmp + cp build/Release/libstdc++-6.dll tmp + cp build/Release/libwinpthread-1.dll tmp cp build/Release/dmdserver.exe tmp cp build/Release/dmdserver_test.exe tmp cp build/Release/dmdutil_static.lib tmp diff --git a/CMakeLists.txt b/CMakeLists.txt index dc1fb57..348b352 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -360,11 +360,14 @@ if(POST_BUILD_COPY_EXT_LIBS AND (PLATFORM STREQUAL "win" OR PLATFORM STREQUAL "w COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb64-1.0.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb64-1.0.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport64.lib" "$" - COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport64-0.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/sockpp64.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/sockpp64.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/pupdmd64.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/pupdmd64.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libgcc_s_seh-1.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libstdc++-6.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libwinpthread-1.dll" "$" ) if(ENABLE_VNI) add_custom_command(TARGET copy_ext_libs POST_BUILD @@ -383,11 +386,14 @@ if(POST_BUILD_COPY_EXT_LIBS AND (PLATFORM STREQUAL "win" OR PLATFORM STREQUAL "w COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libusb-1.0.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libusb-1.0.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/libserialport.lib" "$" - COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libserialport-0.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/sockpp.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/sockpp.dll" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/build-libs/${PLATFORM}/${ARCH}/pupdmd.lib" "$" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/pupdmd.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libgcc_s_dw2-1.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libstdc++-6.dll" "$" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_SOURCE_DIR}/third-party/runtime-libs/${PLATFORM}/${ARCH}/libwinpthread-1.dll" "$" ) if(ENABLE_VNI) add_custom_command(TARGET copy_ext_libs POST_BUILD diff --git a/README.md b/README.md index 5c0e724..a28b91b 100644 --- a/README.md +++ b/README.md @@ -321,12 +321,12 @@ Options: Requires [MSYS2](https://www.msys2.org/) dependencies: ```shell -pacman -S make diffutils mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-libwinpthread mingw-w64-ucrt-x86_64-cmake +pacman -S make diffutils autoconf automake libtool mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-libwinpthread mingw-w64-ucrt-x86_64-cmake ``` ```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 ``` @@ -334,12 +334,12 @@ cmake --build build --config Release Requires [MSYS2](https://www.msys2.org/) dependencies: ```shell -pacman -S make diffutils mingw-w64-i686-gcc mingw-w64-i686-libwinpthread mingw-w64-i686-cmake +pacman -S make diffutils autoconf automake libtool mingw-w64-i686-gcc mingw-w64-i686-libwinpthread mingw-w64-i686-cmake ``` ```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 ``` diff --git a/include/DMDUtil/DMDUtil.h b/include/DMDUtil/DMDUtil.h index b4dfd6f..ddaf754 100644 --- a/include/DMDUtil/DMDUtil.h +++ b/include/DMDUtil/DMDUtil.h @@ -2,7 +2,7 @@ #define DMDUTIL_VERSION_MAJOR 0 // X Digits #define DMDUTIL_VERSION_MINOR 13 // Max 2 Digits -#define DMDUTIL_VERSION_PATCH 1 // Max 2 Digits +#define DMDUTIL_VERSION_PATCH 2 // Max 2 Digits #define _DMDUTIL_STR(x) #x #define DMDUTIL_STR(x) _DMDUTIL_STR(x) diff --git a/platforms/config.sh b/platforms/config.sh index 0a04af8..a6337ef 100755 --- a/platforms/config.sh +++ b/platforms/config.sh @@ -2,10 +2,10 @@ set -e -LIBZEDMD_SHA=a9e856e7cd3fdb3a2a9bd994bd382f68a0b5da18 -LIBSERUM_SHA=55939dfe645f6a2e01785bec2cf6d723bf62def4 -LIBPUPDMD_SHA=1e2becff70450e0dd52dbaef767f89728d7957cd -LIBVNI_SHA=aec04d88f70c3ef642df9f68c4b41c9418fdf704 +LIBZEDMD_SHA=24044222a83ffed33f93d9f0a0baa68fe9fa5a47 +LIBSERUM_SHA=a8cc5ae322e6ecc00b9537bacba2210dc929ccd1 +LIBPUPDMD_SHA=4a1123220e6dce73c87cc584494df2ac82cb6f4c +LIBVNI_SHA=99a4ce0c844af75604546d8a4d0a2f98a485e2db LIBUSB_SHA=15a7ebb4d426c5ce196684347d2b7cafad862626 if [ -z "${BUILD_TYPE}" ]; then diff --git a/platforms/win/x64/external.sh b/platforms/win/x64/external.sh index ca110b5..61d43b1 100755 --- a/platforms/win/x64/external.sh +++ b/platforms/win/x64/external.sh @@ -2,6 +2,13 @@ set -e +if [ -z "${MSYS2_PATH}" ]; then + MSYS2_PATH="/c/msys64" +fi + +echo "MSYS2_PATH: ${MSYS2_PATH}" +echo "" + source ./platforms/config.sh echo "Building libraries..." @@ -24,18 +31,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:Configuration=${BUILD_TYPE} \ - -p:Platform=x64 \ - -p:PlatformToolset=v143 +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/${BUILD_TYPE}/libusb_dll/../dll/libusb64-1.0.lib ../../third-party/build-libs/win/x64 -cp build/v143/x64/${BUILD_TYPE}/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 .. # @@ -48,7 +60,7 @@ mv libzedmd-${LIBZEDMD_SHA} libzedmd cd libzedmd BUILD_TYPE=${BUILD_TYPE} platforms/win/x64/external.sh cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -DPLATFORM=win \ -DARCH=x64 \ -DBUILD_SHARED=ON \ @@ -64,9 +76,12 @@ cp third-party/include/libserialport.h ../../third-party/include/ cp third-party/build-libs/win/x64/cargs64.lib ../../third-party/build-libs/win/x64/ cp third-party/runtime-libs/win/x64/cargs64.dll ../../third-party/runtime-libs/win/x64/ cp third-party/build-libs/win/x64/libserialport64.lib ../../third-party/build-libs/win/x64/ -cp third-party/runtime-libs/win/x64/libserialport64.dll ../../third-party/runtime-libs/win/x64/ +cp third-party/runtime-libs/win/x64/libserialport64-0.dll ../../third-party/runtime-libs/win/x64/ cp third-party/build-libs/win/x64/sockpp64.lib ../../third-party/build-libs/win/x64/ cp third-party/runtime-libs/win/x64/sockpp64.dll ../../third-party/runtime-libs/win/x64/ +cp third-party/runtime-libs/win/x64/libgcc_s_seh-1.dll ../../third-party/runtime-libs/win/x64/ +cp third-party/runtime-libs/win/x64/libstdc++-6.dll ../../third-party/runtime-libs/win/x64/ +cp third-party/runtime-libs/win/x64/libwinpthread-1.dll ../../third-party/runtime-libs/win/x64/ cp build/${BUILD_TYPE}/zedmd64.lib ../../third-party/build-libs/win/x64/ cp build/${BUILD_TYPE}/zedmd64.dll ../../third-party/runtime-libs/win/x64/ cp -r test ../../ @@ -81,7 +96,7 @@ tar xzf libserum-${LIBSERUM_SHA}.tar.gz mv libserum-${LIBSERUM_SHA} libserum cd libserum cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -DPLATFORM=win \ -DARCH=x64 \ -DBUILD_SHARED=ON \ @@ -107,7 +122,7 @@ tar xzf libpupdmd-${LIBPUPDMD_SHA}.tar.gz mv libpupdmd-${LIBPUPDMD_SHA} libpupdmd cd libpupdmd cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -DPLATFORM=win \ -DARCH=x64 \ -DBUILD_SHARED=ON \ @@ -128,7 +143,7 @@ tar xzf libvni-${LIBVNI_SHA}.tar.gz mv libvni-${LIBVNI_SHA} libvni cd libvni cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -DPLATFORM=win \ -DARCH=x64 \ -DBUILD_SHARED=ON \ diff --git a/platforms/win/x64/libusb/libusb_dll.vcxproj b/platforms/win/x64/libusb/libusb_dll.vcxproj deleted file mode 100644 index 54804c8..0000000 --- a/platforms/win/x64/libusb/libusb_dll.vcxproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - - {349EE8FA-7D25-4909-AAF5-FF3FADE72187} - - - - - - - - - - - - - $(IntDir)..\dll\ - libusb-1.0 - - - - libusb-1.0.rc;%(EmbedManagedResourceFile) - ..\libusb\libusb-1.0.def - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - diff --git a/platforms/win/x86/external.sh b/platforms/win/x86/external.sh index ef7fccb..5b13a1c 100755 --- a/platforms/win/x86/external.sh +++ b/platforms/win/x86/external.sh @@ -2,6 +2,13 @@ set -e +if [ -z "${MSYS2_PATH}" ]; then + MSYS2_PATH="/c/msys64" +fi + +echo "MSYS2_PATH: ${MSYS2_PATH}" +echo "" + source ./platforms/config.sh echo "Building libraries..." @@ -24,16 +31,17 @@ 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 -# remove patch after this is fixed: https://github.com/libusb/libusb/issues/1649#issuecomment-2940138443 -cp ../../platforms/win/x86/libusb/libusb_dll.vcxproj msvc -msbuild.exe msvc/libusb_dll.vcxproj \ - -p:Configuration=${BUILD_TYPE} \ - -p:Platform=Win32 \ - -p:PlatformToolset=v143 +CURRENT_DIR="$(pwd)" +MSYSTEM=MINGW32 "${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/Win32/${BUILD_TYPE}/libusb_dll/../dll/libusb-1.0.lib ../../third-party/build-libs/win/x86 -cp build/v143/Win32/${BUILD_TYPE}/libusb_dll/../dll/libusb-1.0.dll ../../third-party/runtime-libs/win/x86 +cp libusb/.libs/libusb-1.0.dll.a ../../third-party/build-libs/win/x86/libusb-1.0.lib +cp libusb/.libs/libusb-1.0.dll ../../third-party/runtime-libs/win/x86/ cd .. # @@ -46,7 +54,7 @@ mv libzedmd-${LIBZEDMD_SHA} libzedmd cd libzedmd BUILD_TYPE=${BUILD_TYPE} platforms/win/x86/external.sh cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -A Win32 \ -DPLATFORM=win \ -DARCH=x86 \ @@ -63,9 +71,12 @@ cp third-party/include/FrameUtil.h ../../third-party/include/ cp third-party/build-libs/win/x86/cargs.lib ../../third-party/build-libs/win/x86/ cp third-party/runtime-libs/win/x86/cargs.dll ../../third-party/runtime-libs/win/x86/ cp third-party/build-libs/win/x86/libserialport.lib ../../third-party/build-libs/win/x86/ -cp third-party/runtime-libs/win/x86/libserialport.dll ../../third-party/runtime-libs/win/x86/ +cp third-party/runtime-libs/win/x86/libserialport-0.dll ../../third-party/runtime-libs/win/x86/ cp third-party/build-libs/win/x86/sockpp.lib ../../third-party/build-libs/win/x86/ cp third-party/runtime-libs/win/x86/sockpp.dll ../../third-party/runtime-libs/win/x86/ +cp third-party/runtime-libs/win/x86/libgcc_s_dw2-1.dll ../../third-party/runtime-libs/win/x86/ +cp third-party/runtime-libs/win/x86/libstdc++-6.dll ../../third-party/runtime-libs/win/x86/ +cp third-party/runtime-libs/win/x86/libwinpthread-1.dll ../../third-party/runtime-libs/win/x86/ cp build/${BUILD_TYPE}/zedmd.lib ../../third-party/build-libs/win/x86/ cp build/${BUILD_TYPE}/zedmd.dll ../../third-party/runtime-libs/win/x86/ cp -r test ../../ @@ -80,7 +91,7 @@ tar xzf libserum-${LIBSERUM_SHA}.tar.gz mv libserum-${LIBSERUM_SHA} libserum cd libserum cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -A Win32 \ -DPLATFORM=win \ -DARCH=x86 \ @@ -107,7 +118,7 @@ tar xzf libpupdmd-${LIBPUPDMD_SHA}.tar.gz mv libpupdmd-${LIBPUPDMD_SHA} libpupdmd cd libpupdmd cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -A Win32 \ -DPLATFORM=win \ -DARCH=x86 \ @@ -129,7 +140,7 @@ tar xzf libvni-${LIBVNI_SHA}.tar.gz mv libvni-${LIBVNI_SHA} libvni cd libvni cmake \ - -G "Visual Studio 17 2022" \ + -G "Visual Studio 18 2026" \ -A Win32 \ -DPLATFORM=win \ -DARCH=x86 \ diff --git a/platforms/win/x86/libusb/libusb_dll.vcxproj b/platforms/win/x86/libusb/libusb_dll.vcxproj deleted file mode 100644 index 54804c8..0000000 --- a/platforms/win/x86/libusb/libusb_dll.vcxproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - - {349EE8FA-7D25-4909-AAF5-FF3FADE72187} - - - - - - - - - - - - - $(IntDir)..\dll\ - libusb-1.0 - - - - libusb-1.0.rc;%(EmbedManagedResourceFile) - ..\libusb\libusb-1.0.def - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - -