소스 검색

Merge pull request #3320 from IvanSavenko/windows_legacy

Fix Windows 7 support
Ivan Savenko 1 년 전
부모
커밋
ebc4aec02d
5개의 변경된 파일33개의 추가작업 그리고 3개의 파일을 삭제
  1. 11 1
      .github/workflows/github.yml
  2. 1 0
      CI/conan/base/cross-macro.j2
  3. 16 0
      CI/mingw-32/before_install.sh
  4. 1 1
      CI/mingw/before_install.sh
  5. 4 1
      CMakeLists.txt

+ 11 - 1
.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

+ 1 - 0
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 -%}

+ 16 - 0
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 -

+ 1 - 1
CI/mingw-ubuntu/before_install.sh → 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 -

+ 4 - 1
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 "")