Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/win-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- main
workflow_dispatch:

permissions:
Expand All @@ -23,15 +26,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Ensure submodules are updated
run: git submodule update --init --recursive

- name: Install Qt 6 (MinGW)
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
tools: 'tools_mingw'
modules: 'qtserialport qtwebsockets'
arch: 'win64_mingw'
# Use the newer MinGW 11.2 toolchain to ensure stable <filesystem> support
tools: 'tools_mingw1120'
modules: 'qtserialport qtwebsockets'

- name: Configure CMake
run: |
Expand Down Expand Up @@ -73,7 +80,12 @@ jobs:
-DCMAKE_PREFIX_PATH="$qtDirCmake" `
-DCMAKE_C_COMPILER="$gccCmake" `
-DCMAKE_CXX_COMPILER="$gppCmake"


- name: Pre-build bundled Protobuf (serial)
run: |
# Build the ExternalProject first to avoid racing it against proto generation
cmake --build build --config Release --target project_protobuf-install -- -j1

- name: Build
run: cmake --build build --config Release --parallel

Expand Down Expand Up @@ -115,12 +127,13 @@ jobs:
run: |
$zipName = "engine-${{ github.ref_name }}-windows-mingw-x64.zip"
Compress-Archive -Path dist/engine-windows/* -DestinationPath $zipName

echo "ZIP_NAME=$zipName" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-release-artifact
path: engine-v*-windows-mingw-x64.zip
path: ${{ env.ZIP_NAME }}
if-no-files-found: error

release-github:
Expand All @@ -138,7 +151,7 @@ jobs:
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
files: engine-v*-windows-mingw-x64.zip
files: engine-${{ github.ref_name }}-windows-mingw-x64.zip
draft: false
generate_release_notes: true
env:
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ include(BuildProtobuf)

# Compile protobuf
include(CompileProtobuf)
set(PROTOBUF_ROOT "${CMAKE_BINARY_DIR}/project_protobuf-prefix") # <- more correct than using 'build/project_protobuf-prefix'
set(PROTOBUF_ROOT "${PROTOBUF_INSTALL_DIR}")
set(Protobuf_PROTOC_EXECUTABLE "${PROTOBUF_ROOT}/bin/protoc")
set(Protobuf_INCLUDE_DIR "${PROTOBUF_ROOT}/include")
# Check if we are on Windows but NOT using MinGW (i.e., using Visual Studio)
Expand All @@ -66,9 +66,9 @@ endif()
set(PROTO_SRC_DIR "${CMAKE_SOURCE_DIR}/src/protobuf/protos")
set(PROTO_GEN_DIR "${CMAKE_SOURCE_DIR}/src/protobuf")
define_proto_generation_target(generate_protos ${PROTO_SRC_DIR} ${PROTO_GEN_DIR})
add_dependencies(generate_protos project_protobuf)
add_dependencies(generate_protos project_protobuf project_protobuf-install)
add_library(proto_files STATIC ${generate_protos_SRCS} ${generate_protos_HDRS})
add_dependencies(proto_files generate_protos)
add_dependencies(proto_files generate_protos project_protobuf project_protobuf-install)
target_include_directories(proto_files PUBLIC
"${PROTO_GEN_DIR}"
"${Protobuf_INCLUDE_DIR}"
Expand Down
10 changes: 7 additions & 3 deletions cmake/BuildProtobuf.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(ExternalProject)

# Define expected output files
set(PROTOBUF_BUILT_FILE "${CMAKE_BINARY_DIR}/protobuf-install/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}")
set(PROTOBUF_BUILT_FILE "${PROTOBUF_INSTALL_DIR}/bin/protoc${CMAKE_EXECUTABLE_SUFFIX}")
set(PROTOBUF_SUBPATH "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(PROTOC_SUBPATH "bin/protoc${CMAKE_EXECUTABLE_SUFFIX}")

Expand All @@ -16,6 +16,7 @@ if(NOT EXISTS "${PROTOBUF_BUILT_FILE}")
DOWNLOAD_NO_PROGRESS true
# PATCH_COMMAND cp ${CMAKE_CURRENT_LIST_DIR}/protobuf.CMakeLists.txt CMakeLists.txt
DOWNLOAD_DIR "${DEPENDENCY_DOWNLOADS}"
INSTALL_DIR "${PROTOBUF_INSTALL_DIR}"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}
Expand All @@ -26,6 +27,9 @@ if(NOT EXISTS "${PROTOBUF_BUILT_FILE}")
-DCMAKE_BUILD_TYPE:STRING=Release
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -std=gnu++11 -w"
-Dprotobuf_BUILD_TESTS:BOOL=OFF
# Disable Zlib to avoid optional dependency failures on the Windows CI runner
-Dprotobuf_WITH_ZLIB:BOOL=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB:BOOL=ON
STEP_TARGETS install
)

Expand Down Expand Up @@ -65,9 +69,9 @@ else()

set(PROTOBUF_FOUND true)
set(PROTOBUF_VERSION "3.6.1")
set(PROTOBUF_INCLUDE_DIR "${CMAKE_BINARY_DIR}/protobuf-install/include")
set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_INSTALL_DIR}/include")
set(PROTOBUF_INCLUDE_DIRS "${PROTOBUF_INCLUDE_DIR}")
set(PROTOBUF_LIBRARY "${CMAKE_BINARY_DIR}/protobuf-install/${PROTOBUF_SUBPATH}")
set(PROTOBUF_LIBRARY "${PROTOBUF_INSTALL_DIR}/${PROTOBUF_SUBPATH}")
set(PROTOBUF_LIBRARIES "${PROTOBUF_LIBRARY}")
set(PROTOBUF_PROTOC_EXECUTABLE "${PROTOBUF_BUILT_FILE}")
set(Protobuf_PROTOC_EXECUTABLE "${PROTOBUF_BUILT_FILE}")
Expand Down
2 changes: 1 addition & 1 deletion src/luainterface/luabindings.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "LuaBindings.hpp"
#include "luabindings.hpp"
#include <iostream>

// ---- Include your project headers here ----
Expand Down
5 changes: 4 additions & 1 deletion src/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ target_include_directories(protobuf PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

# Link Protobuf to the library
#find_package(Protobuf REQUIRED)
target_link_libraries(protobuf PUBLIC protobuf::libprotobuf)
target_link_libraries(protobuf PUBLIC protobuf::libprotobuf)

# Ensure the external Protobuf build/install completes before this target
add_dependencies(protobuf project_protobuf project_protobuf-install)
Loading