Skip to content
Closed
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
199 changes: 199 additions & 0 deletions .github/workflows/FreeBSD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Build Packages

on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- 'appveyor.yml'
- '.travis.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- 'appveyor.yml'
- '.travis.yml'

env:
VERSION: 2024.2
THUNDER_RELEASE: ${{ startsWith(github.ref, 'refs/tags/2') }}
DEPS: git llvm17 libinotify openal-soft xorg 7-zip cmake ninja pkgconf ccache
QT: qt5-widgets qt5-core qt5-gamepad qt5-gui qt5-svg qt5-xml qmake qt5
CC: clang17
CXX: clang++17
CCACHE_CFLAGS: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
CCACHE_DIR: ".ccache"
CCACHE_COMPRESS: "true"
CCACHE_COMPRESSLEVEL: "4"
CCACHE_MAXSIZE: "1G"

jobs:
freebsd:
runs-on: ubuntu-latest
name: FreeBSD CMake
steps:
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: bash
run: |
echo "timestamp=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
- name: Build FreeBSD 14.1 Packages
id: freebsd-14-1
uses: vmactions/freebsd-vm@v1
with:
envs: '
DEPS QT CC CXX
CCACHE_FLAGS
CCACHE_DIR
CCACHE_COMPRESS
CCACHE_COMPRESSLEVEL
CCACHE_MAXSIZE
'
usesh: true
sync: rsync
release: "14.1"
prepare: |
pkg install -y $DEPS
pkg install -y $QT
run: |
ccache -z
git clone --recursive --depth 1 https://github.com/thunder-engine/thunder
mkdir -pv tmp
cd tmp
CC=$CC CXX=$CXX cmake $CCACHE_FLAGS ../thunder -G "Ninja"
ninja -j 1
ninja install
mkdir -pv release
mv -v install-root release
7z a -t7z ../ThunderEngine-freebsd-14.1-x86_64.7z release/install-root
ccache -s
- name: Upload Latest Thunder Release
uses: actions/upload-artifact@v4
with:
name: ThunderEngine-freebsd-14.1-x86_64.7z
path: ThunderEngine-freebsd-14.1-x86_64.7z
- name: Cache FreeBSD 14.1 ccache files
uses: actions/cache@v4
with:
envs: '
CCACHE_DIR
'
path: "$CCACHE_DIR-bsd-14-1"
key: FreeBSD-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}-${{ hashfiles('**') }}
- name: Adjust Hostname FreeBSD 14.1
id: adjust-hostname
run:
hostname freebsd-latest-complete
- name: Build FreeBSD 14.0 Packages
id: freebsd-14-0
uses: vmactions/freebsd-vm@v1
with:
envs: '
DEPS QT CC CXX
CCACHE_FLAGS
CCACHE_DIR
CCACHE_COMPRESS
CCACHE_COMPRESSLEVEL
CCACHE_MAXSIZE
'
usesh: true
sync: rsync
release: "14.0"
prepare: |
pkg install -y $DEPS
pkg install -y $QT
run: |
ccache -z
git clone --recursive --depth 1 https://github.com/thunder-engine/thunder
mkdir -pv tmp
cd tmp
CC=$CC CXX=$CXX cmake $CCACHE_FLAGS ../thunder -G "Ninja"
ninja -j 1
ninja install
ccache -s
- name: Adjust Hostname FreeBSD 14.0
id: adjust-hostname-14-0
run:
hostname freebsd-14-0-complete
- name: Cache FreeBSD 14.0 ccache files
uses: actions/cache@v4
with:
envs: '
CCACHE_DIR
'
path: "$CCACHE_DIR-bsd-14-0"
key: FreeBSD-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}-${{ hashfiles('**') }}
- name: Build FreeBSD 13.3 Packages
id: freebsd-13-3
uses: vmactions/freebsd-vm@v1
with:
envs: '
DEPS QT CC CXX
CCACHE_FLAGS
CCACHE_DIR
CCACHE_COMPRESS
CCACHE_COMPRESSLEVEL
CCACHE_MAXSIZE
'
usesh: true
sync: rsync
release: "13.3"
prepare: |
pkg install -y $DEPS
pkg install -y $QT
run: |
ccache -z
git clone --recursive --depth 1 https://github.com/thunder-engine/thunder
mkdir -pv tmp
cd tmp
CC=$CC CXX=$CXX cmake $CCACHE_FLAGS ../thunder -G "Ninja"
ninja -j 1
ninja install
ccache -s
- name: Adjust Hostname FreeBSD 13.3
id: adjust-hostname-13-3
run:
hostname freebsd-13-3-complete
- name: Cache FreeBSD 13.3 ccache files
uses: actions/cache@v4
with:
envs: '
CCACHE_DIR
'
path: "$CCACHE_DIR-bsd-13-3"
key: FreeBSD-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}-${{ hashfiles('**') }}
- name: Build FreeBSD 13.2 Packages
id: freebsd-13-2
uses: vmactions/freebsd-vm@v1
with:
envs: '
DEPS QT CC CXX
CCACHE_FLAGS
CCACHE_DIR
CCACHE_COMPRESS
CCACHE_COMPRESSLEVEL
CCACHE_MAXSIZE
'
usesh: true
sync: rsync
release: "13.2"
prepare: |
pkg install -y $DEPS
pkg install -y $QT
run: |
ccache -z
git clone --recursive --depth 1 https://github.com/thunder-engine/thunder
mkdir -pv tmp
cd tmp
CC=$CC CXX=$CXX cmake $CCACHE_FLAGS ../thunder -G "Ninja"
ninja -j 1
ninja install
ccache -s
- name: Cache FreeBSD 13.3 ccache files
uses: actions/cache@v4
with:
envs: '
CCACHE_DIR
'
path: "$CCACHE_DIR-bsd-13-2"
key: FreeBSD-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}-${{ hashfiles('**') }}
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ find_package(Qt5 COMPONENTS
Svg
)

# Saving for the CMake builds for other platforms
#if ($ENV{GITHUB_RUNNER} == 1)
# # configure ccache with CMake using: https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
# file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}" ccache_basedir)
# set(ENV{CCACHE_BASEDIR} "${ccache_basedir}")
#
# # set the BSD ccache directory
# if (UNIX AND NOT APPLE AND NOT LINUX)
# set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache-FreeBSD")
# endif()
#
# set(ENV{CCACHE_COMPRESS} "true")
# set(ENV{CCACHE_COMPRESSLEVEL} "6")
# set(ENV{CCACHE_MAXSIZE} "400M")
#endif()

set(QT_BIN_DIR "$ENV{QT5_DIR}/bin")
set(QT_PLUGINS_DIR "$ENV{QT5_DIR}/plugins")
set(QT_QML_DIR "$ENV{QT5_DIR}/qml")
Expand Down
26 changes: 13 additions & 13 deletions modules/vms/angel/src/bindings/angelcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bool connect(Object *sender, const std::string &signal, Object *receiver, const
void registerObject(asIScriptEngine *engine) {
engine->RegisterObjectType("Object", 0, asOBJ_REF | asOBJ_NOCOUNT);

engine->RegisterGlobalFunction("bool _connect(Object @, const std::string &in, Object @, const std::string &in)", asFUNCTION(connect), asCALL_CDECL);
engine->RegisterGlobalFunction("bool _connect(Object @, const string &in, Object @, const string &in)", asFUNCTION(connect), asCALL_CDECL);
}

Object *objectCreate1(const std::string &type) {
Expand Down Expand Up @@ -64,27 +64,27 @@ void unloadResource(const std::string &name) {
void registerEngine(asIScriptEngine *engine) {
engine->SetDefaultNamespace("Engine");

engine->RegisterGlobalFunction("Object @objectCreate(const std::string &in)", asFUNCTION(objectCreate1), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @objectCreate(const std::string &in, const std::string &in)", asFUNCTION(objectCreate2), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @objectCreate(const std::string &in, const std::string &in, Object &in)", asFUNCTION(objectCreate3), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @objectCreate(const string &in)", asFUNCTION(objectCreate1), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @objectCreate(const string &in, const string &in)", asFUNCTION(objectCreate2), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @objectCreate(const string &in, const string &in, Object &in)", asFUNCTION(objectCreate3), asCALL_CDECL);

engine->RegisterGlobalFunction("Actor @composeActor(const std::string &in, const std::string &in, Object &in)", asFUNCTION(composeActor), asCALL_CDECL);
engine->RegisterGlobalFunction("Actor @composeActor(const string &in, const string &in, Object &in)", asFUNCTION(composeActor), asCALL_CDECL);

engine->RegisterGlobalFunction("Object @loadResource(const std::string &in)", asFUNCTION(loadResource), asCALL_CDECL);
engine->RegisterGlobalFunction("void unloadResource(const std::string &in)", asFUNCTION(unloadResource), asCALL_CDECL);
engine->RegisterGlobalFunction("Object @loadResource(const string &in)", asFUNCTION(loadResource), asCALL_CDECL);
engine->RegisterGlobalFunction("void unloadResource(const string &in)", asFUNCTION(unloadResource), asCALL_CDECL);

engine->RegisterGlobalFunction("Scene @loadScene(const std::string &in, bool)", asFUNCTION(Engine::loadScene), asCALL_CDECL);
engine->RegisterGlobalFunction("Scene @loadScene(const string &in, bool)", asFUNCTION(Engine::loadScene), asCALL_CDECL);
engine->RegisterGlobalFunction("void unloadScene(Scene &)", asFUNCTION(Engine::unloadScene), asCALL_CDECL);

engine->SetDefaultNamespace("");
}

void registerCore(asIScriptEngine *engine) {
engine->RegisterGlobalFunction("void debug(const std::string &in)", asFUNCTION(debugFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void info(const std::string &in)", asFUNCTION(infoFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void warning(const std::string &in)", asFUNCTION(warningFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void error(const std::string &in)", asFUNCTION(errorFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void critical(const std::string &in)", asFUNCTION(criticalFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void debug(const string &in)", asFUNCTION(debugFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void info(const string &in)", asFUNCTION(infoFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void warning(const string &in)", asFUNCTION(warningFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void error(const string &in)", asFUNCTION(errorFunction), asCALL_CDECL);
engine->RegisterGlobalFunction("void critical(const string &in)", asFUNCTION(criticalFunction), asCALL_CDECL);

registerObject(engine);
}