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

@@ -119,21 +119,29 @@ if (YAZE_BUILD_LIB)
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${ASAR_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
${SDL2_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
)
# Conditionally add PNG include dirs if available
if(PNG_FOUND)
target_include_directories(yaze_c PUBLIC ${PNG_INCLUDE_DIRS})
endif()
target_link_libraries(
yaze_c PRIVATE
asar-static
${ABSL_TARGETS}
${SDL_TARGETS}
${PNG_LIBRARIES}
${CMAKE_DL_LIBS}
ImGuiTestEngine
ImGui
)
# Conditionally link PNG if available
if(PNG_FOUND)
target_link_libraries(yaze_c PRIVATE ${PNG_LIBRARIES})
endif()
if (YAZE_INSTALL_LIB)
install(TARGETS yaze_c