updated cmakelists, now can be added as subdir and hopefully most of library work done
This commit is contained in:
parent
7fe9d6d491
commit
d8378484a7
1 changed files with 44 additions and 7 deletions
|
|
@ -11,35 +11,72 @@ endfunction()
|
|||
|
||||
option(ARCHEUS_STD_DEBUG "Build in debug mode" ON)
|
||||
option(ARCHEUS_STD_DEFAULT_CONFIG "Build with default config keys" ON)
|
||||
option(ARCHEUS_STD_SDL "Build with SDL" ON)
|
||||
|
||||
set(ARCHEUS_STD_FLAGS "")
|
||||
|
||||
if(ARCHEUS_STD_DEBUG)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g ")
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g -ggdb ")
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_DEFAULT_CONFIG)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_DEFAULT_CONFIG ")
|
||||
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})
|
||||
|
||||
add_library(archeus_std SHARED)
|
||||
|
||||
target_sources(archeus_std PRIVATE
|
||||
set(ARCHEUS_STD_SOURCES
|
||||
src/std/config.c
|
||||
# src/arc_ecs.c
|
||||
src/std/handler.c
|
||||
src/std/hashtable.c
|
||||
src/std/io.c
|
||||
src/std/string.c
|
||||
src/std/vector.c
|
||||
src/std/handler.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
|
||||
include
|
||||
PUBLIC ${SDL2_INCLUDE_DIRS}
|
||||
PUBLIC ${SDL2IMAGE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
install(TARGETS archeus_std EXPORT archeus_std_Exports
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue