mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
Merge pull request #1022 from MihailRis/rename-voxelengine-to-voxelcore-in-cmake
complete the rename of voxelengine to voxelcore
This commit is contained in:
commit
7130a62593
21 changed files with 52 additions and 54 deletions
6
.github/workflows/appimage.yml
vendored
6
.github/workflows/appimage.yml
vendored
|
|
@ -50,13 +50,13 @@ jobs:
|
|||
- name: Run engine tests
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
chmod +x build/VoxelEngine
|
||||
chmod +x build/VoxelCore
|
||||
chmod +x AppDir/usr/bin/vctest
|
||||
AppDir/usr/bin/vctest -e build/VoxelEngine -d dev/tests -u build --memchecker valgrind
|
||||
AppDir/usr/bin/vctest -e build/VoxelCore -d dev/tests -u build --memchecker valgrind
|
||||
- name: Build AppImage
|
||||
uses: AppImageCrafters/build-appimage-action@fe2205a4d6056be47051f7b1b3811106e9814910
|
||||
env:
|
||||
UPDATE_INFO: gh-releases-zsync|MihailRis|VoxelEngine-Cpp|latest|*x86_64.AppImage.zsync
|
||||
UPDATE_INFO: gh-releases-zsync|MihailRis|voxelcore|latest|*x86_64.AppImage.zsync
|
||||
with:
|
||||
recipe: dev/AppImageBuilder.yml
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
6
.github/workflows/cmake.yml
vendored
6
.github/workflows/cmake.yml
vendored
|
|
@ -62,7 +62,7 @@ jobs:
|
|||
# Build your program with the given configuration
|
||||
run: |
|
||||
cmake --build ${{github.workspace}}/build --config ${{inputs.build_type}}
|
||||
mv ${{github.workspace}}/build/VoxelEngine VoxelEngine
|
||||
mv ${{github.workspace}}/build/VoxelCore VoxelCore
|
||||
- name: Run tests
|
||||
if: ${{ inputs.run_tests }}
|
||||
run: ctest --test-dir ${{github.workspace}}/build
|
||||
|
|
@ -70,7 +70,7 @@ jobs:
|
|||
if: ${{ inputs.upload_artifacts }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: VoxelEngine
|
||||
name: VoxelCore
|
||||
path: |
|
||||
VoxelEngine
|
||||
VoxelCore
|
||||
res/*
|
||||
|
|
|
|||
20
.github/workflows/macos.yml
vendored
20
.github/workflows/macos.yml
vendored
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
run: chmod +x dev/fix_dylibs.sh
|
||||
|
||||
- name: Fix dylibs
|
||||
run: ./dev/fix_dylibs.sh VoxelEngine Release build
|
||||
run: ./dev/fix_dylibs.sh VoxelCore Release build
|
||||
|
||||
- name: Run tests
|
||||
run: ctest --output-on-failure --test-dir build
|
||||
|
|
@ -47,19 +47,19 @@ jobs:
|
|||
- name: Run engine tests
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
chmod +x build/VoxelEngine
|
||||
chmod +x build/VoxelCore
|
||||
chmod +x AppDir/usr/bin/vctest
|
||||
AppDir/usr/bin/vctest -e build/VoxelEngine -d dev/tests -u build --output-always --debugger "lldb -batch -o 'run' -o 'thread backtrace all' -o 'quit' -- "
|
||||
AppDir/usr/bin/vctest -e build/VoxelCore -d dev/tests -u build --output-always --debugger "lldb -batch -o 'run' -o 'thread backtrace all' -o 'quit' -- "
|
||||
- name: Create DMG
|
||||
run: |
|
||||
mkdir VoxelEngineDmgContent
|
||||
cp -r build/res VoxelEngineDmgContent/
|
||||
cp -r build/VoxelEngine VoxelEngineDmgContent/
|
||||
cp -r build/libs VoxelEngineDmgContent/libs
|
||||
hdiutil create VoxelEngineMacApp.dmg -volname "VoxelEngine" -srcfolder VoxelEngineDmgContent -ov -format UDZO
|
||||
mkdir VoxelCoreDmgContent
|
||||
cp -r build/res VoxelCoreDmgContent/
|
||||
cp -r build/VoxelCore VoxelCoreDmgContent/
|
||||
cp -r build/libs VoxelCoreDmgContent/libs
|
||||
hdiutil create VoxelCoreMacApp.dmg -volname "VoxelCore" -srcfolder VoxelCoreDmgContent -ov -format UDZO
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: VoxelEngineMacOs
|
||||
path: VoxelEngineMacApp.dmg
|
||||
name: VoxelCoreMacOs
|
||||
path: VoxelCoreMacApp.dmg
|
||||
|
|
|
|||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
|||
mkdir release
|
||||
mv ./artifacts/AppImage/VoxelCore-latest-x86_64.AppImage \
|
||||
./release/voxelcore-${RELEASE_VERSION}_x86-64.AppImage
|
||||
mv ./artifacts/VoxelEngineMacOs/VoxelEngineMacApp.dmg \
|
||||
mv ./artifacts/VoxelCoreMacOs/VoxelCoreMacApp.dmg \
|
||||
./release/voxelcore-${RELEASE_VERSION}_macos.dmg
|
||||
(cd ./artifacts/Windows-Build && zip -r ../../release/voxelcore-${RELEASE_VERSION}_win64.zip .)
|
||||
ls -la ./release
|
||||
|
|
|
|||
3
.github/workflows/windows-clang.yml
vendored
3
.github/workflows/windows-clang.yml
vendored
|
|
@ -59,11 +59,10 @@ jobs:
|
|||
run: |
|
||||
mkdir packaged
|
||||
mkdir packaged/res
|
||||
cp build/VoxelEngine.exe packaged/
|
||||
cp build/VoxelCore.exe packaged/
|
||||
cp build/vctest/vctest.exe packaged/
|
||||
cp build/*.dll packaged/
|
||||
cp -r build/res/* packaged/res/
|
||||
mv packaged/VoxelEngine.exe packaged/VoxelCore.exe
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows-Build
|
||||
|
|
|
|||
3
.github/workflows/windows.yml
vendored
3
.github/workflows/windows.yml
vendored
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
run: ctest --preset default-vs-msvc-windows
|
||||
- name: Run engine tests
|
||||
run: |
|
||||
build/vctest/RelWithDebInfo/vctest.exe -e build/RelWithDebInfo/VoxelEngine.exe -d dev/tests -u build
|
||||
build/vctest/RelWithDebInfo/vctest.exe -e build/RelWithDebInfo/VoxelCore.exe -d dev/tests -u build
|
||||
timeout-minutes: 5
|
||||
- name: Package for Windows
|
||||
run: |
|
||||
|
|
@ -45,7 +45,6 @@ jobs:
|
|||
cp -r build/RelWithDebInfo/* packaged/
|
||||
cp build/vctest/RelWithDebInfo/vctest.exe packaged/
|
||||
cp C:/Windows/System32/msvcp140.dll packaged/msvcp140.dll
|
||||
mv packaged/VoxelEngine.exe packaged/VoxelCore.exe
|
||||
working-directory: ${{ github.workspace }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
project(VoxelEngine)
|
||||
project(VoxelCore)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
|
@ -27,23 +27,23 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_executable(VoxelEngine src/main.cpp)
|
||||
add_executable(VoxelCore src/main.cpp)
|
||||
|
||||
if(VOXELENGINE_BUILD_APPDIR)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/dev/cmake/BuildAppdir.cmake)
|
||||
endif()
|
||||
|
||||
target_link_libraries(VoxelEngine PRIVATE VoxelEngineSrc
|
||||
target_link_libraries(VoxelCore PRIVATE VoxelCoreSrc
|
||||
$<$<PLATFORM_ID:Windows>:winmm>)
|
||||
|
||||
target_link_options(VoxelEngine PRIVATE $<$<CXX_COMPILER_ID:GNU>:-no-pie>)
|
||||
target_link_options(VoxelCore PRIVATE $<$<CXX_COMPILER_ID:GNU>:-no-pie>)
|
||||
|
||||
# Deploy res to build dir
|
||||
add_custom_command(
|
||||
TARGET VoxelEngine
|
||||
TARGET VoxelCore
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/res $<TARGET_FILE_DIR:VoxelEngine>/res)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/res $<TARGET_FILE_DIR:VoxelCore>/res)
|
||||
|
||||
if(VOXELENGINE_BUILD_TESTS)
|
||||
enable_testing()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Build docker container: docker build -t voxelcore .
|
||||
# Build project: docker run --rm -it -v$(pwd):/project voxelcore bash -c "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -Bbuild && cmake --build build"
|
||||
# Run project in docker: docker run --rm -it -v$(pwd):/project -v/tmp/.X11-unix:/tmp/.X11-unix -v${XAUTHORITY}:/home/user/.Xauthority:ro -eDISPLAY --network=host voxelcore ./build/VoxelEngine
|
||||
# Run project in docker: docker run --rm -it -v$(pwd):/project -v/tmp/.X11-unix:/tmp/.X11-unix -v${XAUTHORITY}:/home/user/.Xauthority:ro -eDISPLAY --network=host voxelcore ./build/VoxelCore
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
LABEL Description="Docker container for building VoxelCore for Linux"
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ docker run --rm -it \
|
|||
-v "$XAUTHORITY:/home/user/.Xauthority:ro" \
|
||||
-e DISPLAY="$DISPLAY" \
|
||||
--network=host \
|
||||
voxel-engine ./build/VoxelEngine
|
||||
voxel-engine ./build/VoxelCore
|
||||
```
|
||||
|
||||
### On Windows
|
||||
|
|
@ -218,5 +218,5 @@ docker run --rm -it -v "${PWD}:/project" voxel-engine bash -c "cmake -DCMAKE_BUI
|
|||
#### Step 4. Run the application
|
||||
|
||||
```powershell
|
||||
docker run --rm -it -v "${PWD}:/project" -e DISPLAY=host.docker.internal:0.0 --network=host voxel-engine ./build/VoxelEngine
|
||||
docker run --rm -it -v "${PWD}:/project" -e DISPLAY=host.docker.internal:0.0 --network=host voxel-engine ./build/VoxelCore
|
||||
```
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ AppDir:
|
|||
name: VoxelCore
|
||||
icon: VoxelCore
|
||||
version: latest
|
||||
exec: usr/bin/VoxelEngine
|
||||
exec: usr/bin/VoxelCore
|
||||
exec_args: --dir $HOME/.config/voxelcore --res $APPDIR/usr/share/VoxelCore/res $@
|
||||
apt:
|
||||
arch: amd64
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ Version=1.0
|
|||
Type=Application
|
||||
Name=VoxelCore
|
||||
Comment=Minecraft-like game engine in C++ with OpenGL
|
||||
TryExec=VoxelEngine
|
||||
Exec=VoxelEngine
|
||||
TryExec=VoxelCore
|
||||
Exec=VoxelCore
|
||||
Icon=VoxelCore
|
||||
MimeType=image/x-foo;
|
||||
Categories=Game;
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/dev/VoxelCore.desktop DESTINATION ${CMAKE_
|
|||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AppDir/usr/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AppDir/usr/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AppDir/usr/bin)
|
||||
install(TARGETS VoxelEngine DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/AppDir/usr/bin)
|
||||
install(TARGETS VoxelCore DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/AppDir/usr/bin)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
local response_received = false
|
||||
|
||||
network.get("https://api.github.com/repos/MihailRis/VoxelEngine-Cpp/releases/latest", function (s)
|
||||
network.get("https://api.github.com/repos/MihailRis/voxelcore/releases/latest", function (s)
|
||||
print(json.parse(s).name)
|
||||
response_received = true
|
||||
end, function (code)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ network.get(
|
|||
)
|
||||
|
||||
-- Example:
|
||||
network.get("https://api.github.com/repos/MihailRis/VoxelEngine-Cpp/releases/latest", function (s)
|
||||
network.get("https://api.github.com/repos/MihailRis/voxelcore/releases/latest", function (s)
|
||||
print(json.parse(s).name) -- will output the name of the latest engine release
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ network.get(
|
|||
)
|
||||
|
||||
-- Пример:
|
||||
network.get("https://api.github.com/repos/MihailRis/VoxelEngine-Cpp/releases/latest", function (s)
|
||||
network.get("https://api.github.com/repos/MihailRis/voxelcore/releases/latest", function (s)
|
||||
print(json.parse(s).name) -- выведет имя последнего релиза движка
|
||||
end)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Format version: 1.1
|
||||
|
||||
This binary data format is developed for use as binary version of JSON in [VoxelEngine-Cpp](https://github.com/MihailRis/VoxelEngine-Cpp) and not compatible with [BSON](https://bsonspec.org/spec.html) due to elements/entries syntax and type codes differences
|
||||
This binary data format is developed for use as binary version of JSON in [voxelcore](https://github.com/MihailRis/voxelcore) and not compatible with [BSON](https://bsonspec.org/spec.html) due to elements/entries syntax and type codes differences
|
||||
|
||||
## Basic types
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp VoxelEngine $out/bin/
|
||||
cp VoxelCore $out/bin/
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
packages.default = voxel-core;
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = "${voxel-core}/bin/VoxelEngine";
|
||||
program = "${voxel-core}/bin/VoxelCore";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
4
run.sh
4
run.sh
|
|
@ -62,5 +62,5 @@ done
|
|||
|
||||
if [[ $run ]]; then
|
||||
echo "[RUN SCRIPT] Run project"
|
||||
./build/VoxelEngine
|
||||
fi
|
||||
./build/VoxelCore
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
project(VoxelEngineSrc)
|
||||
project(VoxelCoreSrc)
|
||||
|
||||
file(GLOB_RECURSE headers ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
|
||||
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
|
||||
|
||||
add_library(VoxelEngineSrc STATIC ${sources} ${headers})
|
||||
add_library(VoxelCoreSrc STATIC ${sources} ${headers})
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
|
|
@ -70,10 +70,10 @@ else()
|
|||
add_library(luajit::luajit ALIAS PkgConfig::luajit)
|
||||
endif()
|
||||
|
||||
target_include_directories(VoxelEngineSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(VoxelCoreSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(
|
||||
VoxelEngineSrc
|
||||
VoxelCoreSrc
|
||||
PRIVATE glfw
|
||||
OpenGL::GL
|
||||
GLEW::GLEW
|
||||
|
|
@ -91,7 +91,7 @@ target_link_libraries(
|
|||
)
|
||||
|
||||
target_compile_options(
|
||||
VoxelEngineSrc
|
||||
VoxelCoreSrc
|
||||
PUBLIC $<$<CXX_COMPILER_ID:MSVC>:
|
||||
/utf-8
|
||||
/MP
|
||||
|
|
@ -129,7 +129,7 @@ target_compile_options(
|
|||
>)
|
||||
|
||||
target_link_options(
|
||||
VoxelEngineSrc
|
||||
VoxelCoreSrc
|
||||
PUBLIC
|
||||
$<$<CXX_COMPILER_ID:GNU>:
|
||||
-no-pie
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
project(VoxelEngineTest)
|
||||
project(VoxelCoreTest)
|
||||
|
||||
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
find_package(GTest)
|
||||
|
||||
add_executable(VoxelEngineTest ${sources})
|
||||
add_executable(VoxelCoreTest ${sources})
|
||||
|
||||
target_link_libraries(VoxelEngineTest PRIVATE VoxelEngineSrc GTest::gtest_main)
|
||||
target_link_libraries(VoxelCoreTest PRIVATE VoxelCoreSrc GTest::gtest_main)
|
||||
|
||||
# HACK: copy res to test/ folder for fixing problem compatibility MultiConfig
|
||||
# and non MultiConfig builds. Delete in future and use only root res folder Also
|
||||
# this resolve problem with ctests, because it set cwd to
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}
|
||||
add_custom_command(
|
||||
TARGET VoxelEngineTest
|
||||
TARGET VoxelCoreTest
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different
|
||||
${CMAKE_SOURCE_DIR}/res ${CMAKE_CURRENT_BINARY_DIR}/res)
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(VoxelEngineTest)
|
||||
gtest_discover_tests(VoxelCoreTest)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ TEST(curltest, curltest) {
|
|||
auto network = network::Network::create(settings);
|
||||
|
||||
network::HttpRequest request {};
|
||||
request.url = "https://raw.githubusercontent.com/MihailRis/VoxelEngine-Cpp/refs/"
|
||||
request.url = "https://raw.githubusercontent.com/MihailRis/voxelcore/refs/"
|
||||
"heads/curl/res/content/base/blocks/lamp.json";
|
||||
request.onResponse = [](network::HttpResponse response) {
|
||||
if (response.body.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue