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:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "project.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "app/gui/icons.h"
|
||||
|
||||
Reference in New Issue
Block a user