-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #698 from zerotacg/feature/cross-compile-for-win32
Feature/cross compile for win32
- Loading branch information
Showing
35 changed files
with
183 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: build 32-Bit windows client | ||
|
||
on: | ||
push: | ||
branches: [ "core4", "feature/*" ] | ||
pull_request: | ||
branches: [ "core4" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
echo "hunter-dir=${{ github.workspace }}/.hunter" >> "$GITHUB_OUTPUT" | ||
echo "cmake-version=3.27.9" >> "$GITHUB_OUTPUT" | ||
echo "cmake-install-dir=/opt/cmake-3.27.9" >> "$GITHUB_OUTPUT" | ||
COMMIT_HASH=${{ github.sha }} | ||
echo "version=sha.${COMMIT_HASH:0:8}" >> "$GITHUB_OUTPUT" | ||
- name: Dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install --yes \ | ||
libasound2-dev \ | ||
libgl1-mesa-dev \ | ||
libjack-dev \ | ||
libpulse-dev \ | ||
libxrandr-dev \ | ||
libxrender-dev \ | ||
libxxf86vm-dev \ | ||
mingw-w64 \ | ||
mingw-w64-tools \ | ||
ninja-build | ||
wget --output-document=/tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v${{ steps.strings.outputs.cmake-version }}/cmake-${{ steps.strings.outputs.cmake-version }}-linux-x86_64.sh | ||
sudo mkdir ${{ steps.strings.outputs.cmake-install-dir }} | ||
sudo sh /tmp/cmake.sh --skip-license --prefix=${{ steps.strings.outputs.cmake-install-dir }} | ||
sudo ln --symbolic --force ${{ steps.strings.outputs.cmake-install-dir }}/bin/cmake /usr/local/bin/cmake | ||
git clone --depth 1 --branch openssl-3.0.12 https://github.com/openssl/openssl.git | ||
cd openssl | ||
./Configure mingw --cross-compile-prefix=i686-w64-mingw32- --prefix=/usr/i686-w64-mingw32 | ||
make | ||
sudo make install | ||
- name: Cache Hunter Dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.strings.outputs.hunter-dir }} | ||
key: ubuntu-latest-hunter-cache | ||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: > | ||
cmake --version; | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-G Ninja | ||
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/CMakeModules/toolchain-mingw.cmake | ||
-DCMAKE_CONFIGURATION_TYPES=Release | ||
-DFINAL_VERSION=OFF | ||
-DHUNTER_CONFIGURATION_TYPES=Release | ||
-DHUNTER_ENABLED=ON | ||
-DHUNTER_ROOT=${{ steps.strings.outputs.hunter-dir }} | ||
-DWITH_DRIVER_OPENAL=ON | ||
-DWITH_DRIVER_OPENGL=ON | ||
-DWITH_INSTALL_LIBRARIES=OFF | ||
-DWITH_NEL_SAMPLES=OFF | ||
-DWITH_NEL_TESTS=OFF | ||
-DWITH_NEL_TOOLS=OFF | ||
-DWITH_RYZOM_CLIENT=ON | ||
-DWITH_RYZOM_SERVER=OFF | ||
-DWITH_RYZOM_TOOLS=OFF | ||
-S ${{ github.workspace }} | ||
- name: Build | ||
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ryzom-client-win32-${{ steps.strings.outputs.version }} | ||
path: ${{ steps.strings.outputs.build-output-dir }}/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
|
||
set(CMAKE_C_COMPILER_TARGET i686-w64-mingw32) | ||
set(CMAKE_CXX_COMPILER_TARGET i686-w64-mingw32) | ||
set(CMAKE_RC_COMPILER_TARGET i686-w64-mingw32) | ||
|
||
set(CMAKE_CROSSCOMPILING TRUE) | ||
set(CMAKE_CROSSCOMPILING_EMULATOR wine) | ||
|
||
set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
# Prefer posix gcc variant for gtest pthread support | ||
find_program(C_COMPILER_FULL_PATH NAMES | ||
${CMAKE_C_COMPILER_TARGET}-gcc-posix | ||
${CMAKE_C_COMPILER_TARGET}-gcc) | ||
if(NOT C_COMPILER_FULL_PATH) | ||
message(FATAL_ERROR "Cross-compiler for ${CMAKE_C_COMPILER_TARGET} not found") | ||
endif() | ||
set(CMAKE_C_COMPILER ${C_COMPILER_FULL_PATH}) | ||
|
||
find_program(CXX_COMPILER_FULL_PATH NAMES | ||
${CMAKE_CXX_COMPILER_TARGET}-g++-posix | ||
${CMAKE_CXX_COMPILER_TARGET}-g++) | ||
if(CXX_COMPILER_FULL_PATH) | ||
set(CMAKE_CXX_COMPILER ${CXX_COMPILER_FULL_PATH}) | ||
endif() | ||
|
||
find_program(RC_COMPILER_FULL_PATH NAMES | ||
${CMAKE_RC_COMPILER_TARGET}-windres) | ||
if(RC_COMPILER_FULL_PATH) | ||
set(CMAKE_RC_COMPILER ${RC_COMPILER_FULL_PATH}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SET(OpenGL_GL_PREFERENCE "LEGACY") | ||
IF(NOT WIN32) | ||
IF(APPLE) | ||
FIND_LIBRARY(CARBON NAMES Carbon) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.