update windows workflow and CMakeLists.txt

This commit is contained in:
MihailRis 2024-06-11 23:36:39 +03:00
parent 4d92bf024a
commit aaeea57fc0
2 changed files with 12 additions and 4 deletions

View File

@ -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: |

View File

@ -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