Fix linux build (#25)
Co-authored-by: Alexander Batalov <alex.batalov@gmail.com>
This commit is contained in:
parent
501ae1161d
commit
571c0db190
|
@ -4,13 +4,13 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/Build.yml'
|
- '.github/workflows/Build.yml'
|
||||||
- 'src/**.c'
|
- 'src/**.cc'
|
||||||
- 'src/**.h'
|
- 'src/**.h'
|
||||||
- '**/CMakeLists.txt'
|
- '**/CMakeLists.txt'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/Build.yml'
|
- '.github/workflows/Build.yml'
|
||||||
- 'src/**.c'
|
- 'src/**.cc'
|
||||||
- 'src/**.h'
|
- 'src/**.h'
|
||||||
- '**/CMakeLists.txt'
|
- '**/CMakeLists.txt'
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ defaults:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
Build:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
@ -28,15 +28,42 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: cmake -B Build -A Win32
|
run: cmake -B build/x86-windows -A Win32
|
||||||
|
|
||||||
- name: Release build
|
- name: Release build
|
||||||
run: cmake --build Build --config Release
|
run: cmake --build build/x86-windows --config Release
|
||||||
|
|
||||||
- name: Artifact
|
- name: Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: fallout2-ce
|
name: x86-windows-fallout2-ce
|
||||||
path: |
|
path: |
|
||||||
Build/*/fallout2-ce.exe
|
build/x86-windows/Release/fallout2-ce.exe
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
build-linux32:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo dpkg --add-architecture i386
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: cmake -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" -B build/x86-linux
|
||||||
|
|
||||||
|
- name: Release build
|
||||||
|
run: cmake --build build/x86-linux --config Release
|
||||||
|
|
||||||
|
- name: Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: x86-linux-fallout2-ce
|
||||||
|
path: |
|
||||||
|
build/x86-linux/fallout2-ce
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
|
@ -259,7 +259,7 @@ add_subdirectory("third_party/fpattern")
|
||||||
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
|
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
|
||||||
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})
|
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
add_subdirectory("third_party/zlib")
|
add_subdirectory("third_party/zlib")
|
||||||
add_subdirectory("third_party/sdl2")
|
add_subdirectory("third_party/sdl2")
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -15,7 +15,9 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
#if _WIN32
|
||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOT USED.
|
// NOT USED.
|
||||||
void (*_idle_func)() = NULL;
|
void (*_idle_func)() = NULL;
|
||||||
|
|
Loading…
Reference in New Issue