mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
commit
466a5ee400
41
.github/workflows/github.yml
vendored
41
.github/workflows/github.yml
vendored
@ -99,14 +99,6 @@ jobs:
|
|||||||
extension: ipa
|
extension: ipa
|
||||||
preset: ios-release-conan
|
preset: ios-release-conan
|
||||||
conan_profile: ios-arm64
|
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
|
- platform: msvc
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
test: 0
|
test: 0
|
||||||
@ -135,7 +127,6 @@ jobs:
|
|||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
run: source '${{github.workspace}}/CI/${{matrix.platform}}/before_install.sh'
|
run: source '${{github.workspace}}/CI/${{matrix.platform}}/before_install.sh'
|
||||||
env:
|
env:
|
||||||
MXE_TARGET: ${{ matrix.mxe }}
|
|
||||||
VCMI_BUILD_PLATFORM: x64
|
VCMI_BUILD_PLATFORM: x64
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
@ -173,40 +164,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
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
|
- name: CMake Preset
|
||||||
if: "${{ matrix.preset != '' }}"
|
|
||||||
run: |
|
run: |
|
||||||
cmake --preset ${{ matrix.preset }}
|
cmake --preset ${{ matrix.preset }}
|
||||||
|
|
||||||
- name: Build
|
|
||||||
if: "${{ matrix.preset == '' }}"
|
|
||||||
run: |
|
|
||||||
cmake --build '${{github.workspace}}/out/build/${{matrix.preset}}'
|
|
||||||
|
|
||||||
- name: Build Preset
|
- name: Build Preset
|
||||||
if: "${{ matrix.preset != '' }}"
|
|
||||||
run: |
|
run: |
|
||||||
cmake --build --preset ${{matrix.preset}}
|
cmake --build --preset ${{matrix.preset}}
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
if: ${{ matrix.test == 1 && matrix.preset != ''}}
|
if: ${{ matrix.test == 1 }}
|
||||||
run: |
|
run: |
|
||||||
ctest --preset ${{matrix.preset}}
|
ctest --preset ${{matrix.preset}}
|
||||||
|
|
||||||
@ -222,7 +189,7 @@ jobs:
|
|||||||
rm -rf _CPack_Packages
|
rm -rf _CPack_Packages
|
||||||
|
|
||||||
- name: Additional logs
|
- name: Additional logs
|
||||||
if: ${{ failure() && steps.cpack.outcome == 'failure' && matrix.platform == 'mxe' }}
|
if: ${{ failure() && steps.cpack.outcome == 'failure' && matrix.platform == 'msvc' }}
|
||||||
run: |
|
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/project.nsi'
|
||||||
cat '${{github.workspace}}/out/build/${{matrix.preset}}/_CPack_Packages/win32/NSIS/NSISOutput.log'
|
cat '${{github.workspace}}/out/build/${{matrix.preset}}/_CPack_Packages/win32/NSIS/NSISOutput.log'
|
||||||
@ -236,7 +203,7 @@ jobs:
|
|||||||
${{github.workspace}}/**/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
|
${{github.workspace}}/**/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
|
||||||
|
|
||||||
- name: Upload build
|
- 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: |
|
run: |
|
||||||
cd '${{github.workspace}}/out/build/${{matrix.preset}}'
|
cd '${{github.workspace}}/out/build/${{matrix.preset}}'
|
||||||
source '${{github.workspace}}/CI/upload_package.sh'
|
source '${{github.workspace}}/CI/upload_package.sh'
|
||||||
@ -254,7 +221,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Trigger Android
|
- name: Trigger Android
|
||||||
uses: peter-evans/repository-dispatch@v1
|
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:
|
with:
|
||||||
token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }}
|
token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }}
|
||||||
repository: vcmi/vcmi-android
|
repository: vcmi/vcmi-android
|
||||||
|
@ -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
|
|
@ -1,7 +1,7 @@
|
|||||||
# Minimum required version greatly affect CMake behavior
|
# Minimum required version greatly affect CMake behavior
|
||||||
# So cmake_minimum_required must be called before the project()
|
# So cmake_minimum_required must be called before the project()
|
||||||
# 3.10.0 is used since it's minimal in MXE dependencies for now
|
# 3.16.0 is used since it's used by our currently oldest suppored system: Ubuntu-20.04
|
||||||
cmake_minimum_required(VERSION 3.10.0)
|
cmake_minimum_required(VERSION 3.16.0)
|
||||||
|
|
||||||
project(VCMI)
|
project(VCMI)
|
||||||
# TODO
|
# TODO
|
||||||
@ -10,9 +10,6 @@ project(VCMI)
|
|||||||
# Cmake put them after all install code of main CMakelists in cmake_install.cmake
|
# 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.
|
# 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:
|
# Vckpg:
|
||||||
# - Improve install code once there is better way to deploy DLLs and Qt plugins
|
# - Improve install code once there is better way to deploy DLLs and Qt plugins
|
||||||
#
|
#
|
||||||
@ -57,9 +54,8 @@ if(APPLE_IOS)
|
|||||||
else()
|
else()
|
||||||
option(ENABLE_TEST "Enable compilation of unit tests" OFF)
|
option(ENABLE_TEST "Enable compilation of unit tests" OFF)
|
||||||
endif()
|
endif()
|
||||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0")
|
|
||||||
option(ENABLE_PCH "Enable compilation using precompiled headers" ON)
|
option(ENABLE_PCH "Enable compilation using precompiled headers" ON)
|
||||||
endif(NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0")
|
|
||||||
option(ENABLE_GITVERSION "Enable Version.cpp with Git commit hash" 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_DEBUG_CONSOLE "Enable debug console for Windows builds" ON)
|
||||||
option(ENABLE_STRICT_COMPILATION "Treat all compiler warnings as errors" OFF)
|
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)
|
set(COPY_CONFIG_ON_BUILD OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# No QT Linguist on MXE
|
|
||||||
if((MINGW) AND (${CMAKE_CROSSCOMPILING}) AND (NOT USING_CONAN))
|
|
||||||
set(ENABLE_TRANSLATIONS OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# Miscellaneous options #
|
# Miscellaneous options #
|
||||||
############################################
|
############################################
|
||||||
@ -138,10 +129,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_
|
|||||||
set(ENABLE_PCH OFF) # broken
|
set(ENABLE_PCH OFF) # broken
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( ${CMAKE_VERSION} VERSION_LESS "3.16.0")
|
|
||||||
set(ENABLE_PCH OFF) #not supported
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_PCH)
|
if(ENABLE_PCH)
|
||||||
macro(enable_pch name)
|
macro(enable_pch name)
|
||||||
target_precompile_headers(${name} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:<StdInc.h$<ANGLE-R>>)
|
target_precompile_headers(${name} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:<StdInc.h$<ANGLE-R>>)
|
||||||
@ -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-sign-compare") # low chance of any significant issues
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-varargs") # emitted in fuzzylite headers, disabled
|
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)
|
if(ENABLE_STRICT_COMPILATION)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
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
|
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)
|
if(ENABLE_LUA)
|
||||||
find_package(luajit)
|
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)
|
if(TARGET luajit::luajit)
|
||||||
message(STATUS "Using LuaJIT provided by system")
|
message(STATUS "Using LuaJIT provided by system")
|
||||||
else()
|
else()
|
||||||
@ -580,9 +553,7 @@ if(WIN32)
|
|||||||
"${CMAKE_FIND_ROOT_PATH}/bin/*.dll")
|
"${CMAKE_FIND_ROOT_PATH}/bin/*.dll")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((${CMAKE_CROSSCOMPILING}) AND (DEFINED MSYS))
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
message(STATUS "Detected MXE build")
|
|
||||||
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
|
|
||||||
# Copy debug versions of libraries if build type is debug
|
# Copy debug versions of libraries if build type is debug
|
||||||
set(debug_postfix d)
|
set(debug_postfix d)
|
||||||
endif()
|
endif()
|
||||||
@ -685,7 +656,7 @@ if(WIN32)
|
|||||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://vcmi.eu/")
|
set(CPACK_NSIS_URL_INFO_ABOUT "http://vcmi.eu/")
|
||||||
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
|
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
|
||||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
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}))
|
if(NOT (${CMAKE_CROSSCOMPILING}))
|
||||||
add_subdirectory(win)
|
add_subdirectory(win)
|
||||||
endif()
|
endif()
|
||||||
|
@ -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)
|
* (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](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 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 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))
|
* [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))
|
* [iOS on macOS](https://wiki.vcmi.eu/How_to_build_VCMI_(iOS))
|
||||||
|
Loading…
Reference in New Issue
Block a user