Skip to content

Commit

Permalink
Building FreeFT for windows & linux on github
Browse files Browse the repository at this point in the history
  • Loading branch information
nadult committed Jan 12, 2025
1 parent 486318d commit b3b9f6a
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 12 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,71 @@ on:
workflow_call:

jobs:
build-windows:
runs-on: windows-2022
env:
VS_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-deps
with:
path: libfwk/windows/libraries
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('libfwk/tools/install_deps.py', 'libfwk/dependencies.json', 'dependencies.json') }}-v1

- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
name: Install dependencies
shell: cmd
run: |
pip install conan
python libfwk/tools/install_deps.py
cd libfwk
python tools/install_deps.py
- name: Build freeft
shell: cmd
run: |
"%MSBUILD_PATH%" windows\freeft.sln /p:Platform=x64 /p:Configuration=Release /p:ClCompileArgs="/MP" /maxcpucount:8
cp libfwk\windows\libraries\bin\OpenAL32.dll .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: FreeFT-${{ github.sha }}
path: |
data/
*.exe
*.dll
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Install Dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt update
sudo apt-get install libsdl2-dev libfreetype-dev libvorbis-dev libogg-dev libopenal-dev libdwarf-dev libelf-dev
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt install libvulkan-dev shaderc glslang-dev vulkan-headers libmpg123-dev libzip-dev
- name: Build freeft
run: |
make -j8 game res_viewer
check-formatting:
runs-on: ubuntu-22.04
steps:
Expand Down
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ endif

SHARED_SRC := \
gfx/texture_cache gfx/drawing gfx/scene_renderer gfx/packed_texture \
sys/config sys/data_sheet \
sys/config sys/data_sheet sys/gfx_device \
net/socket net/base net/chunk net/host net/server net/client \
occluder_map base navi_map navi_heightmap grid grid_intersect \
game/tile game/sprite game/sprites game/sprite_legacy game/tile_map game/tile_map_legacy game/entity_map \
Expand All @@ -40,14 +40,16 @@ SHARED_SRC := \
hud/base hud/widget hud/layer hud/button hud/edit_box hud/console hud/grid hud/target_info \
hud/char_icon hud/weapon hud/inventory hud/hud hud/main_panel hud/options hud/class hud/character hud/stats \
hud/multi_player_menu \
ui/window ui/button ui/tile_list ui/progress_bar ui/list_box ui/text_box ui/message_box \
ui/window ui/button ui/progress_bar ui/list_box ui/text_box ui/message_box \
ui/file_dialog ui/edit_box ui/combo_box ui/image_button ui/loading_bar \
io/controller io/loop io/main_menu_loop io/game_loop \
audio/device audio/device_music audio/mp3_decoder \
editor/tile_selector editor/tiles_editor editor/entities_editor editor/group_editor\
editor/tiles_pad editor/group_pad editor/tile_group editor/view editor/entities_pad \
res_manager

# TODO: to be fixed
# ui/tile_list editor/tile_selector editor/tiles_editor editor/entities_editor editor/group_editor\
# editor/tiles_pad editor/group_pad editor/tile_group editor/view editor/entities_pad \
DEPRECATED_SRC:= temp/frame_allocator

PROGRAM_SRC := editor game res_viewer convert lobby_server
Expand All @@ -69,16 +71,12 @@ $(OBJECTS): $(BUILD_DIR)/%.o: src/%.cpp $(PCH_TARGET)
$(PROGRAMS): %$(PROGRAM_SUFFIX): $(SHARED_OBJECTS) $(BUILD_DIR)/%.o $(FWK_LIB_FILE)
$(LINKER) -o $@ $^ $(LDFLAGS)

build/res_embedded.cpp: data_embed/fonts/* data_embed/* make_embedded.sh $(PACKAGER)
./make_embedded.sh
src/res_manager.cpp: build/res_embedded.cpp

$(PACKAGER): $(FWK_LIB_FILE) .FORCE
$(MAKE) $(FWK_MAKE_ARGS) tools/packager

DEPS:=$(ALL_SRC:%=$(BUILD_DIR)/%.d) $(PCH_TEMP).d

JUNK_FILES := $(OBJECTS) $(PROGRAMS) $(DEPS) build/res_embedded.cpp
JUNK_FILES := $(OBJECTS) $(PROGRAMS) $(DEPS)
JUNK_DIRS := $(SUBDIRS)

# --- Other stuff ---------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libfwk
Submodule libfwk updated 1 files
+1 −1 Makefile
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct GameApp {
Canvas2D canvas(IRect(window_size), Orient2D::y_up);
m_main_loop->draw(canvas);
m_gfx_device.drawFrame(canvas).check();
TextureCache::instance().nextFrame();
TextureCache::instance().nextFrame().check();
audio::tick();
return true;
}
Expand Down
1 change: 0 additions & 1 deletion src/sys/gfx_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "gfx_device.h"

#include <fwk/gfx/canvas_2d.h>
#include <fwk/gfx/shader_compiler.h>
#include <fwk/vulkan/vulkan_command_queue.h>
#include <fwk/vulkan/vulkan_device.h>
#include <fwk/vulkan/vulkan_image.h>
Expand Down
2 changes: 2 additions & 0 deletions src/sys/gfx_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "base.h"
#include "config.h"

#include <fwk/gfx/shader_compiler.h>

struct GfxDevice {
static Ex<GfxDevice> create(ZStr name, const Config &);
Ex<> drawFrame(Canvas2D &);
Expand Down

0 comments on commit b3b9f6a

Please sign in to comment.