diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index a0f6b69a9..ac20a6aea 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -116,7 +116,7 @@ jobs: pack_type: RelWithDebInfo extension: exe preset: windows-msvc-release-ccache - - platform: mingw-ubuntu + - platform: mingw os: ubuntu-22.04 test: 0 pack: 1 @@ -126,6 +126,16 @@ jobs: cmake_args: -G Ninja preset: windows-mingw-conan-linux conan_profile: mingw64-linux.jinja + - platform: mingw-32 + os: ubuntu-22.04 + test: 0 + pack: 1 + pack_type: Release + extension: exe + cpack_args: -D CPACK_NSIS_EXECUTABLE=`which makensis` + cmake_args: -G Ninja + preset: windows-mingw-conan-linux + conan_profile: mingw32-linux.jinja - platform: android-32 os: ubuntu-22.04 extension: apk diff --git a/CI/conan/base/cross-macro.j2 b/CI/conan/base/cross-macro.j2 index a1829b5f6..7f4edf0ee 100644 --- a/CI/conan/base/cross-macro.j2 +++ b/CI/conan/base/cross-macro.j2 @@ -17,4 +17,5 @@ RC={{ target_host }}-windres {% macro generate_conf(target_host) -%} tools.build:compiler_executables = {"c": "{{ target_host }}-gcc", "cpp": "{{ target_host }}-g++"} tools.build:sysroot = /usr/{{ target_host }} +tools.build:defines = ["WINVER=0x0601", "_WIN32_WINNT=0x0601"] {%- endmacro -%} \ No newline at end of file diff --git a/CI/mingw-32/before_install.sh b/CI/mingw-32/before_install.sh new file mode 100644 index 000000000..2bb40f7d1 --- /dev/null +++ b/CI/mingw-32/before_install.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +sudo apt-get update +sudo apt-get install ninja-build mingw-w64 nsis +sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix + +# Workaround for getting new MinGW headers on Ubuntu 22.04. +# Remove it once MinGW headers version in repository will be 10.0 at least +curl -O -L http://mirrors.kernel.org/ubuntu/pool/universe/m/mingw-w64/mingw-w64-common_10.0.0-3_all.deb \ + && sudo dpkg -i mingw-w64-common_10.0.0-3_all.deb; +curl -O -L http://mirrors.kernel.org/ubuntu/pool/universe/m/mingw-w64/mingw-w64-i686-dev_10.0.0-3_all.deb \ + && sudo dpkg -i mingw-w64-i686-dev_10.0.0-3_all.deb; + +mkdir ~/.conan ; cd ~/.conan +curl -L "https://github.com/vcmi/vcmi-deps-windows-conan/releases/download/1.1/vcmi-deps-windows-conan-w32.tgz" \ + | tar -xzf - diff --git a/CI/mingw-ubuntu/before_install.sh b/CI/mingw/before_install.sh similarity index 93% rename from CI/mingw-ubuntu/before_install.sh rename to CI/mingw/before_install.sh index bc1acca52..37babba74 100755 --- a/CI/mingw-ubuntu/before_install.sh +++ b/CI/mingw/before_install.sh @@ -12,5 +12,5 @@ curl -O -L http://mirrors.kernel.org/ubuntu/pool/universe/m/mingw-w64/mingw-w64- && sudo dpkg -i mingw-w64-x86-64-dev_10.0.0-3_all.deb; mkdir ~/.conan ; cd ~/.conan -curl -L "https://github.com/vcmi/vcmi-deps-windows-conan/releases/download/1.0/vcmi-deps-windows-conan-w64.tgz" \ +curl -L "https://github.com/vcmi/vcmi-deps-windows-conan/releases/download/1.1/vcmi-deps-windows-conan-w64.tgz" \ | tar -xzf - diff --git a/CMakeLists.txt b/CMakeLists.txt index b502b3fbf..f04a3a2c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,10 @@ endif() if(MINGW OR MSVC) # Windows Vista or newer for FuzzyLite 6 to compile - add_definitions(-D_WIN32_WINNT=0x0600) + # Except for conan which already has this definition in its preset + if(NOT USING_CONAN) + add_definitions(-D_WIN32_WINNT=0x0600) + endif() #delete lib prefix for dlls (libvcmi -> vcmi) set(CMAKE_SHARED_LIBRARY_PREFIX "")