Enhance CMake configuration for PNG support and introduce vcpkg.json

- Updated CMakeLists.txt to conditionally enable PNG support based on the presence of the PNG library, improving compatibility for minimal builds.
- Added vcpkg.json to manage project dependencies, including zlib, libpng, sdl2, and abseil, streamlining package management.
- Modified CI workflow in ci.yml to simplify CMake configuration commands for better readability.
- Enhanced CMake scripts to ensure proper handling of dependencies in both minimal and regular builds, improving build reliability.
This commit is contained in:
scawful
2025-09-25 09:56:32 -04:00
parent 163aa9e121
commit d26f58be2f
8 changed files with 72 additions and 19 deletions

View File

@@ -45,11 +45,15 @@ target_include_directories(
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
${PNG_INCLUDE_DIRS}
${SDL2_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
)
# Conditionally add PNG include dirs if available
if(PNG_FOUND)
target_include_directories(yaze PUBLIC ${PNG_INCLUDE_DIRS})
endif()
# Conditionally link nfd if available
if(YAZE_HAS_NFD)
target_link_libraries(yaze PRIVATE nfd)
@@ -63,12 +67,16 @@ target_link_libraries(
asar-static
${ABSL_TARGETS}
${SDL_TARGETS}
${PNG_LIBRARIES}
${CMAKE_DL_LIBS}
ImGui
ImGuiTestEngine
)
# Conditionally link PNG if available
if(PNG_FOUND)
target_link_libraries(yaze PUBLIC ${PNG_LIBRARIES})
endif()
if (APPLE)
target_link_libraries(yaze PUBLIC ${COCOA_LIBRARY})
endif()

View File

@@ -1,6 +1,7 @@
#include "project.h"
#include <fstream>
#include <sstream>
#include <string>
#include "app/gui/icons.h"