mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
Merge branch 'dev' of https://github.com/MihailRis/voxelcore into dev
This commit is contained in:
commit
e2e7f8711b
10 changed files with 59 additions and 11 deletions
7
.github/workflows/appimage.yml
vendored
7
.github/workflows/appimage.yml
vendored
|
|
@ -11,6 +11,11 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
description: 'Build name passed as VC_BUILD_NAME define'
|
||||
version_patch:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
description: 'Engine version patch number passed as VC_VERSION_PATCH define'
|
||||
|
||||
jobs:
|
||||
build-appimage:
|
||||
|
|
@ -36,7 +41,7 @@ jobs:
|
|||
sudo ln -s /usr/lib/x86_64-linux-gnu/libluajit-5.1.a /usr/lib/x86_64-linux-gnu/liblua5.1.a
|
||||
sudo ln -s /usr/include/luajit-2.1 /usr/include/lua
|
||||
- name: Configure
|
||||
run: cmake -S . -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1 -DVOXELENGINE_BUILD_TESTS=ON -DVC_BUILD_NAME="${{ inputs.build_name }}"
|
||||
run: cmake -S . -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1 -DVOXELENGINE_BUILD_TESTS=ON -DVC_BUILD_NAME="${{ inputs.build_name }}" -DVC_VERSION_PATCH="${{ inputs.version_patch }}"
|
||||
- name: Build
|
||||
run: cmake --build build -t install
|
||||
- name: Run tests
|
||||
|
|
|
|||
7
.github/workflows/macos.yml
vendored
7
.github/workflows/macos.yml
vendored
|
|
@ -11,6 +11,11 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
description: 'Build name passed as VC_BUILD_NAME define'
|
||||
version_patch:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
description: 'Engine version patch number passed as VC_VERSION_PATCH define'
|
||||
|
||||
jobs:
|
||||
build-dmg:
|
||||
|
|
@ -29,7 +34,7 @@ jobs:
|
|||
run: |
|
||||
cmake -DOPENAL_INCLUDE_DIR=$(brew --prefix openal-soft)/include \
|
||||
-DOPENAL_LIBRARY=$(brew --prefix openal-soft)/lib/libopenal.dylib \
|
||||
-S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOXELENGINE_BUILD_TESTS=ON -DVOXELENGINE_BUILD_APPDIR=1 -DVC_BUILD_NAME="${{ inputs.build_name }}"
|
||||
-S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVOXELENGINE_BUILD_TESTS=ON -DVOXELENGINE_BUILD_APPDIR=1 -DVC_BUILD_NAME="${{ inputs.build_name }}" -DVC_VERSION_PATCH="${{ inputs.version_patch }}"
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
|
|
|
|||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
|
@ -13,24 +13,32 @@ jobs:
|
|||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "exists just for outputs"
|
||||
- id: version
|
||||
run: |
|
||||
if [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.([0-9]+) ]]; then
|
||||
echo "patch=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
outputs:
|
||||
build_name: '${{ env.RELEASE_VERSION }}'
|
||||
version_patch: '${{ steps.version.outputs.patch }}'
|
||||
build_linux:
|
||||
needs: [prepare]
|
||||
uses: ./.github/workflows/appimage.yml
|
||||
with:
|
||||
build_name: '${{ needs.prepare.outputs.build_name }}'
|
||||
version_patch: '${{ needs.prepare.outputs.version_patch }}'
|
||||
build_macos:
|
||||
needs: [prepare]
|
||||
uses: ./.github/workflows/macos.yml
|
||||
with:
|
||||
build_name: '${{ needs.prepare.outputs.build_name }}'
|
||||
version_patch: '${{ needs.prepare.outputs.version_patch }}'
|
||||
build_windows:
|
||||
needs: [prepare]
|
||||
uses: ./.github/workflows/windows-clang.yml
|
||||
with:
|
||||
build_name: '${{ needs.prepare.outputs.build_name }}'
|
||||
version_patch: '${{ needs.prepare.outputs.version_patch }}'
|
||||
publish_release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build_linux, build_macos, build_windows]
|
||||
|
|
|
|||
7
.github/workflows/windows-clang.yml
vendored
7
.github/workflows/windows-clang.yml
vendored
|
|
@ -11,6 +11,11 @@ on:
|
|||
required: true
|
||||
type: string
|
||||
description: 'Build name passed as VC_BUILD_NAME define'
|
||||
version_patch:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
description: 'Engine version patch number passed as VC_VERSION_PATCH define'
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
|
|
@ -53,7 +58,7 @@ jobs:
|
|||
export VCPKG_ROOT=$(pwd)/vcpkg
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVC_BUILD_NAME="${{ inputs.build_name }}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
||||
cmake -G "MinGW Makefiles" -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVC_BUILD_NAME="${{ inputs.build_name }}" -DVC_VERSION_PATCH="${{ inputs.version_patch }}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
||||
cmake --build . --config Release
|
||||
- name: Package for Windows
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -12,6 +12,14 @@ option(VOXELENGINE_BUILD_TESTS "Build tests" OFF)
|
|||
|
||||
add_compile_definitions(VC_BUILD_NAME="${VC_BUILD_NAME}")
|
||||
|
||||
set(VC_VERSION_PATCH "" CACHE STRING "Engine version patch number")
|
||||
if(NOT VC_VERSION_PATCH STREQUAL "")
|
||||
if(NOT VC_VERSION_PATCH MATCHES "^[0-9]+$")
|
||||
message(FATAL_ERROR "invalid VC_VERSION_PATCH: '${VC_VERSION_PATCH}'")
|
||||
endif()
|
||||
add_compile_definitions(VC_VERSION_PATCH=${VC_VERSION_PATCH})
|
||||
endif()
|
||||
|
||||
# Need for static compilation on Windows with MSVC clang TODO: Make single build
|
||||
# on Windows to avoid dependence on combinations of platforms and compilers and
|
||||
# make it independent
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ app.close_world(
|
|||
|
||||
```lua
|
||||
-- Returns the major and minor versions of the engine.
|
||||
app.get_version() -> int, int
|
||||
-- If a patch number is available, it also returns it.
|
||||
app.get_version() -> int, int, int | nil
|
||||
|
||||
-- Returns the value of a setting.
|
||||
-- Throws an exception if the setting does not exist.
|
||||
|
|
|
|||
|
|
@ -116,7 +116,8 @@ app.close_world(
|
|||
|
||||
```lua
|
||||
-- Возвращает мажорную и минорную версии движка.
|
||||
app.get_version() -> int, int
|
||||
-- При наличии номера патча возвращает и его.
|
||||
app.get_version() -> int, int, int | nil
|
||||
|
||||
-- Возвращает значение настройки.
|
||||
-- Бросает исключение, если настройки не существует.
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@
|
|||
|
||||
inline constexpr int ENGINE_VERSION_MAJOR = 0;
|
||||
inline constexpr int ENGINE_VERSION_MINOR = 33;
|
||||
#ifdef VC_VERSION_PATCH
|
||||
inline constexpr int ENGINE_VERSION_PATCH = VC_VERSION_PATCH;
|
||||
#else
|
||||
inline constexpr int ENGINE_VERSION_PATCH = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
inline constexpr bool ENGINE_DEBUG_BUILD = false;
|
||||
|
|
@ -14,7 +19,13 @@ inline constexpr bool ENGINE_DEBUG_BUILD = false;
|
|||
inline constexpr bool ENGINE_DEBUG_BUILD = true;
|
||||
#endif // NDEBUG
|
||||
|
||||
inline const std::string ENGINE_VERSION_STRING = "0.33";
|
||||
inline const std::string ENGINE_VERSION_STRING =
|
||||
std::to_string(ENGINE_VERSION_MAJOR) + "." +
|
||||
std::to_string(ENGINE_VERSION_MINOR)
|
||||
#ifdef VC_VERSION_PATCH
|
||||
+ "." + std::to_string(ENGINE_VERSION_PATCH)
|
||||
#endif
|
||||
;
|
||||
|
||||
inline constexpr uint MAX_SUBPROCESSES = 1;
|
||||
inline constexpr uint MAX_SUBPROCESS_DEPTH = 2;
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ WindowControl::Result WindowControl::initialize() {
|
|||
#endif
|
||||
title += "VoxelCore v";
|
||||
if (buildName.empty()) {
|
||||
title += std::to_string(ENGINE_VERSION_MAJOR) + "." +
|
||||
std::to_string(ENGINE_VERSION_MINOR);
|
||||
title += ENGINE_VERSION_STRING;
|
||||
} else {
|
||||
title += buildName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,10 +328,15 @@ static int l_delete_world(lua::State* L) {
|
|||
}
|
||||
|
||||
/// @brief Get engine version
|
||||
/// @return major, minor
|
||||
/// @return major, minor, [patch]
|
||||
static int l_get_version(lua::State* L) {
|
||||
return lua::pushvec_stack(
|
||||
L, glm::vec2(ENGINE_VERSION_MAJOR, ENGINE_VERSION_MINOR)
|
||||
L,
|
||||
#ifdef VC_VERSION_PATCH
|
||||
glm::vec3(ENGINE_VERSION_MAJOR, ENGINE_VERSION_MINOR, ENGINE_VERSION_PATCH)
|
||||
#else
|
||||
glm::vec2(ENGINE_VERSION_MAJOR, ENGINE_VERSION_MINOR)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue