sdl2 now working again I think, but with better cmake

This commit is contained in:
herbglitch 2024-02-08 17:47:32 -07:00
parent c822075173
commit 3e15b6dfd0
16 changed files with 78 additions and 52 deletions

View file

@ -31,6 +31,14 @@ set_property(CACHE ARCHEUS_STD_GRAPHICS_BACKEND PROPERTY STRINGS NONE SDL2 OPENG
set(ARCHEUS_STD_FLAGS "")
set(ARCHEUS_STD_LIBRARIES "")
set(ARCHEUS_STD_INCLUDE_DIRECTORIES
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
set(ARCHEUS_STD_LINK_LIBRARIES
PUBLIC m
)
# ~ ARCHEUS_SOURCES ~ #
set(ARCHEUS_STD_SOURCES
src/std/config.c
@ -71,7 +79,7 @@ none_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_W
# ~ SDL2 ~ #
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_sdl2.cmake)
sdl2_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
sdl2_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ARCHEUS_STD_INCLUDE_DIRECTORIES ARCHEUS_STD_LINK_LIBRARIES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
# ~ OPENGL ~ #
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_opengl.cmake)
@ -93,13 +101,9 @@ else()
add_library(archeus_std SHARED ${ARCHEUS_STD_SOURCES})
endif()
target_include_directories(archeus_std
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_include_directories(archeus_std ${ARCHEUS_STD_INCLUDE_DIRECTORIES})
target_link_libraries(archeus_std
PUBLIC m
)
target_link_libraries(archeus_std ${ARCHEUS_STD_LINK_LIBRARIES})
install(TARGETS archeus_std EXPORT archeus_std_Exports
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}