From e090f8fa1e1ff66170e41384ae0300ff77c49b79 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:20:52 +0300 Subject: [PATCH 01/19] add EnTT library requirement --- .github/workflows/cmake.yml | 7 +++++++ .github/workflows/macos.yml | 4 ++-- CMakeLists.txt | 1 + README.md | 10 +++++++++- vcpkg.json | 3 ++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 075c4b74..022b0824 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -38,6 +38,13 @@ jobs: sudo apt-get install libglfw3-dev libglfw3 libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev sudo ln -s /usr/lib/x86_64-linux-gnu/libluajit-5.1.a /usr/lib/x86_64-linux-gnu/liblua-5.1.a sudo ln -s /usr/include/luajit-2.1 /usr/include/lua + - name: Install EnTT + run: | + git clone https://github.com/skypjack/entt.git + cd entt/build + cmake -DCMAKE_BUILD_TYPE=Release .. + sudo make install + cd ../.. - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 371e1ac1..dd7152ab 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies from brew run: | - brew install glfw3 glew libpng openal-soft luajit libvorbis + brew install glfw3 glew libpng openal-soft luajit libvorbis skypjack/entt/entt - name: Install specific version of GLM run: | @@ -48,4 +48,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: VoxelEngineMacOs - path: VoxelEngineMacApp.dmg \ No newline at end of file + path: VoxelEngineMacApp.dmg diff --git a/CMakeLists.txt b/CMakeLists.txt index 1da3b155..271238e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) find_package(OpenAL REQUIRED) find_package(ZLIB REQUIRED) +find_package(EnTT REQUIRED) if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) diff --git a/README.md b/README.md index b248c8ed..65422cfc 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,14 @@ cmake --build . ## Install libs: +#### Install EnTT +```sh +git clone https://github.com/skypjack/entt.git +cd entt/build +cmake -DCMAKE_BUILD_TYPE=Release .. +sudo make install +``` + #### Debian-based distro: ```sh sudo apt install libglfw3-dev libglfw3 libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev @@ -59,7 +67,7 @@ sudo pacman -S glfw-wayland glew glm libpng libvorbis openal luajit #### macOS: ``` -brew install glfw3 glew glm libpng libvorbis lua luajit openal-soft +brew install glfw3 glew glm libpng libvorbis lua luajit openal-soft skypjack/entt/entt ``` If homebrew for some reason could not install the necessary packages: ```lua luajit openal-soft```, then download, install and compile them manually (Lua, LuaJIT and OpenAL). diff --git a/vcpkg.json b/vcpkg.json index 8a5f6049..b53f9d40 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -10,6 +10,7 @@ "libspng", "zlib", "luajit", - "libvorbis" + "libvorbis", + "entt" ] } From 2548338001215e214d0195ec1fa7784787afdfc8 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:31:43 +0300 Subject: [PATCH 02/19] update appimage workflow --- .github/workflows/appimage.yml | 7 +++++++ .github/workflows/cmake.yml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 3a6c64e9..00b7e0be 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -24,8 +24,15 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential libglfw3-dev libglfw3 libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev cmake squashfs-tools + # fix luajit paths 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 + # install EnTT + git clone https://github.com/skypjack/entt.git + cd entt/build + cmake -DCMAKE_BUILD_TYPE=Release .. + sudo make install + cd ../.. - name: configure run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_APPDIR=1 - name: build diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 022b0824..dce8c120 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -36,10 +36,10 @@ jobs: run: | sudo apt-get update sudo apt-get install libglfw3-dev libglfw3 libglew-dev libglm-dev libpng-dev libopenal-dev libluajit-5.1-dev libvorbis-dev + # fix luajit paths sudo ln -s /usr/lib/x86_64-linux-gnu/libluajit-5.1.a /usr/lib/x86_64-linux-gnu/liblua-5.1.a sudo ln -s /usr/include/luajit-2.1 /usr/include/lua - - name: Install EnTT - run: | + # install EnTT git clone https://github.com/skypjack/entt.git cd entt/build cmake -DCMAKE_BUILD_TYPE=Release .. From d9ffe7a62fdd39584ef596e797e38eeac65f7210 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:37:04 +0300 Subject: [PATCH 03/19] update macos workflow --- .github/workflows/macos.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dd7152ab..0fb525ca 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,7 +17,8 @@ jobs: - name: Install dependencies from brew run: | - brew install glfw3 glew libpng openal-soft luajit libvorbis skypjack/entt/entt + brew install glfw3 glew libpng openal-soft luajit libvorbis + brew install skypjack/entt/entt --HEAD - name: Install specific version of GLM run: | From 240cea1f60a4d6c85212bf0f3751ab306164e184 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:43:46 +0300 Subject: [PATCH 04/19] update macos workflow --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0fb525ca..ae4c0f7f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,7 +18,7 @@ jobs: - name: Install dependencies from brew run: | brew install glfw3 glew libpng openal-soft luajit libvorbis - brew install skypjack/entt/entt --HEAD + brew install skypjack/entt/entt --with-docs - name: Install specific version of GLM run: | From 412b63048c695fc16bba95c347e94f7ff06c6ec3 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:56:58 +0300 Subject: [PATCH 05/19] update CMakeLists.txt --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 271238e5..8d069178 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,9 @@ find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) find_package(OpenAL REQUIRED) find_package(ZLIB REQUIRED) -find_package(EnTT REQUIRED) +if (NOT APPLE) + find_package(EnTT REQUIRED) +endif() if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) @@ -138,7 +140,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() include_directories(${LUA_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB ${VORBISLIB} ${PNGLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) +target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB EnTT::EnTT ${VORBISLIB} ${PNGLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) From 5115eca40cf5bb61ed57b53e2f86b0d51bf6c8c5 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 21:58:57 +0300 Subject: [PATCH 06/19] update macos workflow --- .github/workflows/macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ae4c0f7f..dd7152ab 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,8 +17,7 @@ jobs: - name: Install dependencies from brew run: | - brew install glfw3 glew libpng openal-soft luajit libvorbis - brew install skypjack/entt/entt --with-docs + brew install glfw3 glew libpng openal-soft luajit libvorbis skypjack/entt/entt - name: Install specific version of GLM run: | From a754cbdf6eb04ebfbbdb520e5e229bc4050b6358 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 22:02:06 +0300 Subject: [PATCH 07/19] add workflows test include & update CMakeLists.txt --- CMakeLists.txt | 2 +- src/voxel_engine.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d069178..11a01b7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() include_directories(${LUA_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB EnTT::EnTT ${VORBISLIB} ${PNGLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) +target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB ${VORBISLIB} ${PNGLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index c6a2ec7e..3e36179e 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -8,6 +8,8 @@ #include +#include // workflows test + static debug::Logger logger("main"); int main(int argc, char** argv) { From fb998ddd5d1f2c31b7977108edd0335b419ec737 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 22:11:41 +0300 Subject: [PATCH 08/19] add complete entt test function --- src/voxel_engine.cpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index 3e36179e..02e4a06a 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -8,13 +8,46 @@ #include -#include // workflows test - static debug::Logger logger("main"); +#include + +struct position { + float x; + float y; +}; + +struct velocity { + float dx; + float dy; +}; + +void update(entt::registry ®istry) { + auto view = registry.view(); + + view.each([](const auto &pos, const auto &vel) { + logger.info() << pos.x << "," << pos.y << " - " << vel.dx << ", " << vel.dy; + }); +} + +int entt_test() { + entt::registry registry; + + for(auto i = 0u; i < 10u; ++i) { + const auto entity = registry.create(); + registry.emplace(entity, i * 1.f, i * 1.f); + if(i % 2 == 0) { registry.emplace(entity, i * .1f, i * .1f); } + } + + update(registry); + return EXIT_SUCCESS; +} + int main(int argc, char** argv) { debug::Logger::init("latest.log"); + return entt_test(); + EnginePaths paths; if (!parse_cmdline(argc, argv, paths)) return EXIT_SUCCESS; From e07ddaee381af8c68008399c45e08069459f7dd7 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 22:19:00 +0300 Subject: [PATCH 09/19] remove entt test code --- src/voxel_engine.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index 02e4a06a..c6a2ec7e 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -10,44 +10,9 @@ static debug::Logger logger("main"); -#include - -struct position { - float x; - float y; -}; - -struct velocity { - float dx; - float dy; -}; - -void update(entt::registry ®istry) { - auto view = registry.view(); - - view.each([](const auto &pos, const auto &vel) { - logger.info() << pos.x << "," << pos.y << " - " << vel.dx << ", " << vel.dy; - }); -} - -int entt_test() { - entt::registry registry; - - for(auto i = 0u; i < 10u; ++i) { - const auto entity = registry.create(); - registry.emplace(entity, i * 1.f, i * 1.f); - if(i % 2 == 0) { registry.emplace(entity, i * .1f, i * .1f); } - } - - update(registry); - return EXIT_SUCCESS; -} - int main(int argc, char** argv) { debug::Logger::init("latest.log"); - return entt_test(); - EnginePaths paths; if (!parse_cmdline(argc, argv, paths)) return EXIT_SUCCESS; From 825eec049d70c6e671625d094a547874036304f6 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:00:09 +0300 Subject: [PATCH 10/19] set VCPKG_TARGET_TRIPLET to x64-windows-static-md --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11a01b7e..09d19928 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ if(MSVC) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) endif() if((CMAKE_BUILD_TYPE EQUAL "Release") OR (CMAKE_BUILD_TYPE EQUAL "RelWithDebInfo")) + set(VCPKG_TARGET_TRIPLET "x64-windows-static-md") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Release>") target_compile_options(${PROJECT_NAME} PRIVATE /W4 /MT /O2) else() From c5006107b98b9e1697fbc3a13c26fe22e606e468 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:13:28 +0300 Subject: [PATCH 11/19] update windows workflow --- .github/workflows/windows.yml | 5 +++-- CMakeLists.txt | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 46fe7122..ece6c911 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,6 +23,7 @@ jobs: - name: Set up vcpkg run: | + set VCPKG_DEFAULT_HOST_TRIPLET=x64-windows-static-md git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat @@ -32,9 +33,9 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. Remove-Item -Path CMakeFiles -Recurse -Force - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. cmake --build . --config Release - name: Package for Windows run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 09d19928..11a01b7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,6 @@ if(MSVC) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) endif() if((CMAKE_BUILD_TYPE EQUAL "Release") OR (CMAKE_BUILD_TYPE EQUAL "RelWithDebInfo")) - set(VCPKG_TARGET_TRIPLET "x64-windows-static-md") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Release>") target_compile_options(${PROJECT_NAME} PRIVATE /W4 /MT /O2) else() From 4d92bf024a5b0adab1cc18353b805e0d21ef0a72 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:16:52 +0300 Subject: [PATCH 12/19] update windows workflow --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ece6c911..9024d2a6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,7 +23,6 @@ jobs: - name: Set up vcpkg run: | - set VCPKG_DEFAULT_HOST_TRIPLET=x64-windows-static-md git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat @@ -31,6 +30,7 @@ jobs: cd .. - name: Configure and build project with CMake and vcpkg run: | + vcpkg install --triplet=x64-windows-static-md mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. From aaeea57fc021d9949955a35094bceba9c8fa9bd4 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:36:39 +0300 Subject: [PATCH 13/19] update windows workflow and CMakeLists.txt --- .github/workflows/windows.yml | 4 ++-- CMakeLists.txt | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9024d2a6..bd21ec04 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,9 +33,9 @@ jobs: vcpkg install --triplet=x64-windows-static-md mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -VOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. Remove-Item -Path CMakeFiles -Recurse -Force - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -VOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. cmake --build . --config Release - name: Package for Windows run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 11a01b7e..fa2b7e1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,6 @@ option(VOXELENGINE_BUILD_WINDOWS_VCPKG OFF) +option(VOXELENGINE_BUILD_STATIC OFF) + if(VOXELENGINE_BUILD_WINDOWS_VCPKG AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") endif() @@ -88,6 +90,8 @@ if (NOT APPLE) find_package(EnTT REQUIRED) endif() +set(ZLIB ZLIB::ZLIB) + if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") @@ -96,9 +100,13 @@ if (WIN32) find_package(spng REQUIRED) find_package(glm REQUIRED) find_package(vorbis REQUIRED) - set(PNGLIB spng::spng) + if(VOXELENGINE_BUILD_STATIC) + set(PNGLIB spng::spng_static) + set(ZLIB zlibstatic) + else() + set(PNGLIB spng::spng) + endif() set(VORBISLIB Vorbis::vorbis Vorbis::vorbisfile) - else() find_package(Lua REQUIRED) set(PNGLIB spng) set(VORBISLIB vorbis vorbisfile) # not tested From 5961e4276b469c9fe10c489f3f183fc196f55ed2 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:41:44 +0300 Subject: [PATCH 14/19] fix windows workflow --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bd21ec04..6a35ec00 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,9 +33,9 @@ jobs: vcpkg install --triplet=x64-windows-static-md mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -VOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. Remove-Item -Path CMakeFiles -Recurse -Force - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -VOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. cmake --build . --config Release - name: Package for Windows run: | From 68a7c776a8d89454064dca8d3e48c01a1a68c244 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 11 Jun 2024 23:53:19 +0300 Subject: [PATCH 15/19] fix lua paths --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa2b7e1b..50b6685b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,6 @@ set(ZLIB ZLIB::ZLIB) if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) - set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") - set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") find_package(glfw3 REQUIRED) find_package(spng REQUIRED) find_package(glm REQUIRED) @@ -103,7 +101,11 @@ if (WIN32) if(VOXELENGINE_BUILD_STATIC) set(PNGLIB spng::spng_static) set(ZLIB zlibstatic) + set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows-static-md/lib/lua51.lib") + set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows-static-md/include/luajit") else() + set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") + set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") set(PNGLIB spng::spng) endif() set(VORBISLIB Vorbis::vorbis Vorbis::vorbisfile) From ea858f4049fbe0dcd8986dd9bf4803a710757b76 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 12 Jun 2024 00:01:23 +0300 Subject: [PATCH 16/19] fix CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50b6685b..2aabae55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,7 @@ if (WIN32) set(PNGLIB spng::spng) endif() set(VORBISLIB Vorbis::vorbis Vorbis::vorbisfile) + else() find_package(Lua REQUIRED) set(PNGLIB spng) set(VORBISLIB vorbis vorbisfile) # not tested From 4f8bf22ef1eb957c74e2d896af6ad3ddc166b113 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 12 Jun 2024 00:22:47 +0300 Subject: [PATCH 17/19] add more logging --- src/voxel_engine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index c6a2ec7e..15f284ca 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -13,9 +13,12 @@ static debug::Logger logger("main"); int main(int argc, char** argv) { debug::Logger::init("latest.log"); + logger.info() << "start of the log (argc=" << argc << ")"; EnginePaths paths; if (!parse_cmdline(argc, argv, paths)) return EXIT_SUCCESS; + + logger.info() << "configuring encoding"; platform::configure_encoding(); try { From 2061665dd204ada80992086069b6b3af3ee5faa3 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 12 Jun 2024 00:43:00 +0300 Subject: [PATCH 18/19] revert workflow experiments --- .github/workflows/windows.yml | 5 ++--- CMakeLists.txt | 16 +++------------- src/voxel_engine.cpp | 3 --- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6a35ec00..46fe7122 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -30,12 +30,11 @@ jobs: cd .. - name: Configure and build project with CMake and vcpkg run: | - vcpkg install --triplet=x64-windows-static-md mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON .. Remove-Item -Path CMakeFiles -Recurse -Force - cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON -DVOXELENGINE_BUILD_STATIC=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static-md .. + cmake -DCMAKE_BUILD_TYPE=Release -DVOXELENGINE_BUILD_WINDOWS_VCPKG=ON .. cmake --build . --config Release - name: Package for Windows run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aabae55..eb546896 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ option(VOXELENGINE_BUILD_WINDOWS_VCPKG OFF) -option(VOXELENGINE_BUILD_STATIC OFF) if(VOXELENGINE_BUILD_WINDOWS_VCPKG AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") @@ -90,24 +89,15 @@ if (NOT APPLE) find_package(EnTT REQUIRED) endif() -set(ZLIB ZLIB::ZLIB) - if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) find_package(glfw3 REQUIRED) find_package(spng REQUIRED) find_package(glm REQUIRED) find_package(vorbis REQUIRED) - if(VOXELENGINE_BUILD_STATIC) - set(PNGLIB spng::spng_static) - set(ZLIB zlibstatic) - set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows-static-md/lib/lua51.lib") - set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows-static-md/include/luajit") - else() - set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") - set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") - set(PNGLIB spng::spng) - endif() + set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") + set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") + set(PNGLIB spng::spng) set(VORBISLIB Vorbis::vorbis Vorbis::vorbisfile) else() find_package(Lua REQUIRED) diff --git a/src/voxel_engine.cpp b/src/voxel_engine.cpp index 15f284ca..c6a2ec7e 100644 --- a/src/voxel_engine.cpp +++ b/src/voxel_engine.cpp @@ -13,12 +13,9 @@ static debug::Logger logger("main"); int main(int argc, char** argv) { debug::Logger::init("latest.log"); - logger.info() << "start of the log (argc=" << argc << ")"; EnginePaths paths; if (!parse_cmdline(argc, argv, paths)) return EXIT_SUCCESS; - - logger.info() << "configuring encoding"; platform::configure_encoding(); try { From a340c8525c6bf27c2d96045000be8fc1ec24e90f Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 12 Jun 2024 00:47:54 +0300 Subject: [PATCH 19/19] revert extra changes in CMakeLists.txt --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb546896..11a01b7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ option(VOXELENGINE_BUILD_WINDOWS_VCPKG OFF) - if(VOXELENGINE_BUILD_WINDOWS_VCPKG AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") endif() @@ -91,12 +90,12 @@ endif() if (WIN32) if(VOXELENGINE_BUILD_WINDOWS_VCPKG) + set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") + set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") find_package(glfw3 REQUIRED) find_package(spng REQUIRED) find_package(glm REQUIRED) find_package(vorbis REQUIRED) - set(LUA_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/lib/lua51.lib") - set(LUA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/luajit_x64-windows/include/luajit") set(PNGLIB spng::spng) set(VORBISLIB Vorbis::vorbis Vorbis::vorbisfile) else()