updated cmakelists, now can be added as subdir and hopefully most of library work done

This commit is contained in:
herbglitch 2023-02-26 23:24:38 -07:00
parent 7fe9d6d491
commit d8378484a7

View file

@ -11,35 +11,72 @@ endfunction()
option(ARCHEUS_STD_DEBUG "Build in debug mode" ON) option(ARCHEUS_STD_DEBUG "Build in debug mode" ON)
option(ARCHEUS_STD_DEFAULT_CONFIG "Build with default config keys" ON) option(ARCHEUS_STD_DEFAULT_CONFIG "Build with default config keys" ON)
option(ARCHEUS_STD_SDL "Build with SDL" ON)
set(ARCHEUS_STD_FLAGS "") set(ARCHEUS_STD_FLAGS "")
if(ARCHEUS_STD_DEBUG) if(ARCHEUS_STD_DEBUG)
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g ") string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g -ggdb ")
endif() endif()
if(ARCHEUS_STD_DEFAULT_CONFIG) if(ARCHEUS_STD_DEFAULT_CONFIG)
string(APPEND ARCHEUS_STD_FLAGS "-DARC_DEFAULT_CONFIG ") string(APPEND ARCHEUS_STD_FLAGS "-DARC_DEFAULT_CONFIG ")
endif() endif()
if(ARCHEUS_STD_SDL)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
string(APPEND ARCHEUS_STD_FLAGS "-DARC_SDL ")
endif()
set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS}) set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS})
add_library(archeus_std SHARED) set(ARCHEUS_STD_SOURCES
target_sources(archeus_std PRIVATE
src/std/config.c src/std/config.c
# src/arc_ecs.c src/std/handler.c
src/std/hashtable.c src/std/hashtable.c
src/std/io.c src/std/io.c
src/std/string.c src/std/string.c
src/std/vector.c src/std/vector.c
src/std/handler.c
src/std/defaults/config.c src/std/defaults/config.c
src/math/rectangle.c
src/math/vector2.c
src/files/config.c
src/engine/engine.c
src/engine/state.c
) )
set(ARCHEUS_STD_SDL_SOURCES
src/input/sdl/keyboard.c
src/input/sdl/mouse.c
src/graphics/sdl/config.c
src/graphics/sdl/line.c
src/graphics/sdl/rectangle.c
src/graphics/sdl/renderer.c
src/graphics/sdl/sprite.c
src/graphics/sdl/spritesheet.c
src/graphics/sdl/window.c
)
add_library(archeus_std SHARED
${ARCHEUS_STD_SOURCES}
${ARCHEUS_STD_SDL_SOURCES}
)
# target_sources(archeus_std PRIVATE
# ${ARCHEUS_STD_SOURCES}
# ${ARCHEUS_STD_SDL_SOURCES}
# )
target_include_directories(archeus_std PRIVATE target_include_directories(archeus_std PRIVATE
include include
PUBLIC ${SDL2_INCLUDE_DIRS}
PUBLIC ${SDL2IMAGE_INCLUDE_DIRS}
) )
install(TARGETS archeus_std EXPORT archeus_std_Exports install(TARGETS archeus_std EXPORT archeus_std_Exports