From a9669578fc31beabc8885b436643b4182247fd6d Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 18:13:51 +0200 Subject: [PATCH 1/6] Remove MXE action from CI --- .github/workflows/github.yml | 8 ------ CI/mxe/before_install.sh | 53 ------------------------------------ 2 files changed, 61 deletions(-) delete mode 100644 CI/mxe/before_install.sh diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index e2b285e6f..b2b967f09 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -99,14 +99,6 @@ jobs: extension: ipa preset: ios-release-conan conan_profile: ios-arm64 - - platform: mxe - os: ubuntu-20.04 - mxe: i686-w64-mingw32.shared - test: 0 - pack: 1 - cpack_args: -D CPACK_NSIS_EXECUTABLE=`which makensis` - extension: exe - cmake_args: -G Ninja - platform: msvc os: windows-latest test: 0 diff --git a/CI/mxe/before_install.sh b/CI/mxe/before_install.sh deleted file mode 100644 index 0a4855f2d..000000000 --- a/CI/mxe/before_install.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# steps to upgrade MXE dependencies: -# 1) Use Debian/Ubuntu system or install one (virtual machines will work too) -# 2) update following script to include any new dependencies -# You can also run it to upgrade existing ones, but don't expect much -# MXE repository only provides ancient versions for the sake of "stability" -# https://github.com/vcmi/vcmi-deps-mxe/blob/master/mirror-mxe.sh -# 3) make release in vcmi-deps-mxe repository using resulting tar archive -# 4) update paths to tar archive in this script - -# Install nsis for installer creation -sudo add-apt-repository 'deb http://security.ubuntu.com/ubuntu bionic-security main' -sudo apt-get install -qq nsis ninja-build libssl1.0.0 - -# MXE repository was too slow for Travis far too often -wget -nv https://github.com/vcmi/vcmi-deps-mxe/releases/download/2021-02-20/mxe-i686-w64-mingw32.shared-2021-01-22.tar -tar -xvf mxe-i686-w64-mingw32.shared-2021-01-22.tar -sudo dpkg -i mxe-*.deb -sudo apt-get install -f --yes - -if false; then - # Add MXE repository and key - echo "deb http://pkg.mxe.cc/repos/apt/debian wheezy main" \ - | sudo tee /etc/apt/sources.list.d/mxeapt.list - - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB - - # Install needed packages - sudo apt-get update -qq - - sudo apt-get install -q --yes \ - mxe-$MXE_TARGET-gcc \ - mxe-$MXE_TARGET-boost \ - mxe-$MXE_TARGET-zlib \ - mxe-$MXE_TARGET-sdl2 \ - mxe-$MXE_TARGET-sdl2-gfx \ - mxe-$MXE_TARGET-sdl2-image \ - mxe-$MXE_TARGET-sdl2-mixer \ - mxe-$MXE_TARGET-sdl2-ttf \ - mxe-$MXE_TARGET-ffmpeg \ - mxe-$MXE_TARGET-qt \ - mxe-$MXE_TARGET-qtbase \ - mxe-$MXE_TARGET-intel-tbb \ - mxe-i686-w64-mingw32.static-luajit - -fi # Disable - -# alias for CMake - -CMAKE_LOCATION=$(which cmake) -sudo mv $CMAKE_LOCATION $CMAKE_LOCATION.orig -sudo ln -s /usr/lib/mxe/usr/bin/$MXE_TARGET-cmake $CMAKE_LOCATION From e938a9bb6c4e5050d4f0555411d93d2503cf1bfd Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 18:14:17 +0200 Subject: [PATCH 2/6] Removed non-preset build from CI config --- .github/workflows/github.yml | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index b2b967f09..7dc53d43b 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -127,7 +127,6 @@ jobs: - name: Dependencies run: source '${{github.workspace}}/CI/${{matrix.platform}}/before_install.sh' env: - MXE_TARGET: ${{ matrix.mxe }} VCMI_BUILD_PLATFORM: x64 - uses: actions/setup-python@v4 @@ -165,40 +164,16 @@ jobs: env: PULL_REQUEST: ${{ github.event.pull_request.number }} - - name: Configure CMake - if: "${{ matrix.preset == '' }}" - run: | - mkdir -p '${{github.workspace}}/out/build/${{matrix.preset}}' - cd '${{github.workspace}}/out/build/${{matrix.preset}}' - cmake \ - ../.. -GNinja \ - ${{matrix.cmake_args}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DENABLE_TEST=${{matrix.test}} \ - -DENABLE_STRICT_COMPILATION=ON \ - -DPACKAGE_NAME_SUFFIX:STRING="$VCMI_PACKAGE_NAME_SUFFIX" \ - -DPACKAGE_FILE_NAME:STRING="$VCMI_PACKAGE_FILE_NAME" \ - -DENABLE_GITVERSION="$VCMI_PACKAGE_GITVERSION" - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - - name: CMake Preset - if: "${{ matrix.preset != '' }}" run: | cmake --preset ${{ matrix.preset }} - - name: Build - if: "${{ matrix.preset == '' }}" - run: | - cmake --build '${{github.workspace}}/out/build/${{matrix.preset}}' - - name: Build Preset - if: "${{ matrix.preset != '' }}" run: | cmake --build --preset ${{matrix.preset}} - name: Test - if: ${{ matrix.test == 1 && matrix.preset != ''}} + if: ${{ matrix.test == 1 }} run: | ctest --preset ${{matrix.preset}} @@ -214,7 +189,7 @@ jobs: rm -rf _CPack_Packages - name: Additional logs - if: ${{ failure() && steps.cpack.outcome == 'failure' && matrix.platform == 'mxe' }} + if: ${{ failure() && steps.cpack.outcome == 'failure' && matrix.platform == 'msvc' }} run: | cat '${{github.workspace}}/out/build/${{matrix.preset}}/_CPack_Packages/win32/NSIS/project.nsi' cat '${{github.workspace}}/out/build/${{matrix.preset}}/_CPack_Packages/win32/NSIS/NSISOutput.log' @@ -228,7 +203,7 @@ jobs: ${{github.workspace}}/**/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }} - name: Upload build - if: ${{ matrix.pack == 1 && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/features/')) && matrix.platform != 'msvc' }} + if: ${{ matrix.pack == 1 && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/features/')) && matrix.platform == 'msvc' }} run: | cd '${{github.workspace}}/out/build/${{matrix.preset}}' source '${{github.workspace}}/CI/upload_package.sh' @@ -246,7 +221,7 @@ jobs: - name: Trigger Android uses: peter-evans/repository-dispatch@v1 - if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') && matrix.platform == 'mxe' }} + if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') && matrix.platform == 'msvc' }} with: token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }} repository: vcmi/vcmi-android From 8e13ed74d7644ea8b1cffae5018561e0fbd0641b Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 18:21:49 +0200 Subject: [PATCH 3/6] CMake version bump to 3.16, removed MXE workarounds --- CMakeLists.txt | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 480f97f41..aec633ff8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Minimum required version greatly affect CMake behavior # So cmake_minimum_required must be called before the project() -# 3.10.0 is used since it's minimal in MXE dependencies for now -cmake_minimum_required(VERSION 3.10.0) +# 3.16.0 is used since it's used by our currently oldest suppored system: Ubuntu-20.04 +cmake_minimum_required(VERSION 3.16.0) project(VCMI) # TODO @@ -10,9 +10,6 @@ project(VCMI) # Cmake put them after all install code of main CMakelists in cmake_install.cmake # Currently I just added extra add_subdirectory and CMakeLists.txt in osx directory to bypass that. # -# MXE: -# - Try to implement MXE support into BundleUtilities so we can deploy deps automatically -# # Vckpg: # - Improve install code once there is better way to deploy DLLs and Qt plugins # @@ -57,9 +54,8 @@ if(APPLE_IOS) else() option(ENABLE_TEST "Enable compilation of unit tests" OFF) endif() -if(NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0") - option(ENABLE_PCH "Enable compilation using precompiled headers" ON) -endif(NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0") + +option(ENABLE_PCH "Enable compilation using precompiled headers" ON) option(ENABLE_GITVERSION "Enable Version.cpp with Git commit hash" ON) option(ENABLE_DEBUG_CONSOLE "Enable debug console for Windows builds" ON) option(ENABLE_STRICT_COMPILATION "Treat all compiler warnings as errors" OFF) @@ -90,11 +86,6 @@ if(APPLE_IOS AND COPY_CONFIG_ON_BUILD) set(COPY_CONFIG_ON_BUILD OFF) endif() -# No QT Linguist on MXE -if((MINGW) AND (${CMAKE_CROSSCOMPILING}) AND (NOT USING_CONAN)) - set(ENABLE_TRANSLATIONS OFF) -endif() - ############################################ # Miscellaneous options # ############################################ @@ -138,10 +129,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_ set(ENABLE_PCH OFF) # broken endif() -if( ${CMAKE_VERSION} VERSION_LESS "3.16.0") - set(ENABLE_PCH OFF) #not supported -endif() - if(ENABLE_PCH) macro(enable_pch name) target_precompile_headers(${name} PRIVATE $<$:>) @@ -296,13 +283,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare") # low chance of any significant issues set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-varargs") # emitted in fuzzylite headers, disabled - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") # emitted only by ancient gcc 5.5 in MXE build, remove after upgrade - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") # emitted only by ancient gcc 5.5 in MXE build, remove after upgrade - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable") # emitted only by ancient gcc 5.5 in MXE build, remove after upgrade - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") # emitted only by ancient gcc 5.5 in MXE build, remove after upgrade - endif() - if(ENABLE_STRICT_COMPILATION) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds") # false positives in boost::multiarray during release build, keep as warning-only @@ -407,14 +387,7 @@ endif() if(ENABLE_LUA) find_package(luajit) - # MXE paths hardcoded for current dependencies pack - tried and could not make it work another way - if((MINGW) AND (${CMAKE_CROSSCOMPILING}) AND (DEFINED MSYS) AND (NOT TARGET luajit::luajit)) - add_library(luajit::luajit STATIC IMPORTED) - set_target_properties(luajit::luajit PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "/usr/lib/mxe/usr/i686-w64-mingw32.static/include/luajit-2.0") - set_target_properties(luajit::luajit PROPERTIES - IMPORTED_LOCATION "/usr/lib/mxe/usr/i686-w64-mingw32.static/lib/libluajit-5.1.a") - endif() + if(TARGET luajit::luajit) message(STATUS "Using LuaJIT provided by system") else() @@ -580,9 +553,7 @@ if(WIN32) "${CMAKE_FIND_ROOT_PATH}/bin/*.dll") endif() - if((${CMAKE_CROSSCOMPILING}) AND (DEFINED MSYS)) - message(STATUS "Detected MXE build") - elseif(CMAKE_BUILD_TYPE MATCHES Debug) + if(CMAKE_BUILD_TYPE MATCHES Debug) # Copy debug versions of libraries if build type is debug set(debug_postfix d) endif() @@ -685,7 +656,7 @@ if(WIN32) set(CPACK_NSIS_URL_INFO_ABOUT "http://vcmi.eu/") set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") - # Use BundleUtilities to fix build when Vcpkg is used and disable it for MXE + # Use BundleUtilities to fix build when Vcpkg is used and disable it for mingw if(NOT (${CMAKE_CROSSCOMPILING})) add_subdirectory(win) endif() From 13dde2c4f3907170bafc408b770587704f08fdfc Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 18:50:22 +0200 Subject: [PATCH 4/6] Removed old info from readme --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 535a192fd..4c6995ddf 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Platform support is constantly tested by continuous integration and CMake config * (optional) All platforms: [using Conan package manager to obtain prebuilt dependencies](docs/conan.md) * [On Linux](https://wiki.vcmi.eu/How_to_build_VCMI_(Linux)) - * [On Linux for Windows with MXE](https://wiki.vcmi.eu/How_to_build_VCMI_(Linux/Cmake/MXE)) * [On macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(macOS)) * [On Windows using MSVC and Vcpkg](https://wiki.vcmi.eu/How_to_build_VCMI_(Windows/Vcpkg)) * [iOS on macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(iOS)) From c72fb1bcfe75a3818309f791b3fbb08af65a96f0 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 19:38:01 +0200 Subject: [PATCH 5/6] Added conan+mingw info to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c6995ddf..e56020618 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Platform support is constantly tested by continuous integration and CMake config * (optional) All platforms: [using Conan package manager to obtain prebuilt dependencies](docs/conan.md) * [On Linux](https://wiki.vcmi.eu/How_to_build_VCMI_(Linux)) + * [On Linux for Windows with Conan and mingw]( https://wiki.vcmi.eu/How_to_build_VCMI_(Linux/Cmake/Conan) * [On macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(macOS)) * [On Windows using MSVC and Vcpkg](https://wiki.vcmi.eu/How_to_build_VCMI_(Windows/Vcpkg)) * [iOS on macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(iOS)) From 2f31033dbaeed1aa4b23a51a3f60f882538eeae3 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Jan 2023 19:48:24 +0200 Subject: [PATCH 6/6] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e56020618..1af484ad5 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Platform support is constantly tested by continuous integration and CMake config * (optional) All platforms: [using Conan package manager to obtain prebuilt dependencies](docs/conan.md) * [On Linux](https://wiki.vcmi.eu/How_to_build_VCMI_(Linux)) - * [On Linux for Windows with Conan and mingw]( https://wiki.vcmi.eu/How_to_build_VCMI_(Linux/Cmake/Conan) + * [On Linux for Windows with Conan and mingw](https://wiki.vcmi.eu/How_to_build_VCMI_(Linux/Cmake/Conan)) * [On macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(macOS)) * [On Windows using MSVC and Vcpkg](https://wiki.vcmi.eu/How_to_build_VCMI_(Windows/Vcpkg)) * [iOS on macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(iOS))