Skip to content

Commit

Permalink
update windows workflow and CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jun 11, 2024
1 parent 4d92bf0 commit aaeea57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit aaeea57

Please sign in to comment.