From 4fd00a9088887567f2d55ec0dbec4b767752bbd8 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sun, 4 Oct 2020 14:07:56 +0900 Subject: [PATCH] CMake: Build modules as a single library --- modules/CMakeLists.txt | 34 +++++++++++++++++++++++++++---- modules/lib/CMakeLists.txt | 41 -------------------------------------- 2 files changed, 30 insertions(+), 45 deletions(-) delete mode 100644 modules/lib/CMakeLists.txt diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 6347c96..09860a5 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -1,7 +1,5 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src) -add_subdirectory(lib) - add_library(modules STATIC modules.c AliceLogo/AliceLogo.c @@ -61,6 +59,31 @@ add_library(modules STATIC dDemo/dDemo.c eDemo/eDemo.c eeDemo/eeDemo.c + lib/alk.c + lib/drawtext.c + lib/graph.c + lib/list.c + lib/surface.c + lib/cg.c + lib/graph_expandcolor_blend.c + lib/graph_fillrect.c + lib/graph_fillrect_amap.c + lib/graph_fillrect_acolor.c + lib/graph_rect.c + lib/graph_copy.c + lib/graph_copy_amap.c + lib/graph_copy_bright.c + lib/graph_copy_whiteout.c + lib/graph_blend_amap.c + lib/graph_blend_screen.c + lib/graph_saturadd_amap.c + lib/graph_draw_amap.c + lib/graph_stretch.c + lib/graph_cg.c + lib/graph_buller.c + lib/gre_blend_useamap.c + lib/gre_blend.c + lib/gre_blend_screen.c nDEMO/nDEMO.c nDEMOE/nDEMOE.c oDEMO/oDEMO.c @@ -68,10 +91,13 @@ add_library(modules STATIC tDemo/tDemo.c ) -target_include_directories(modules PUBLIC .) +target_include_directories(modules PUBLIC . lib) + +add_executable(modules_tests lib/list_test.c) +target_link_libraries(modules_tests PRIVATE modules) +add_test(NAME modules_tests COMMAND modules_tests) target_compile_options(modules PRIVATE -Wno-pointer-sign) -target_link_libraries(modules PRIVATE graph alk drawtext list) if (SDL2MIXER_FOUND) if (ANDROID) diff --git a/modules/lib/CMakeLists.txt b/modules/lib/CMakeLists.txt deleted file mode 100644 index 766099c..0000000 --- a/modules/lib/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -add_library(graph STATIC - graph.c - surface.c - cg.c - graph_expandcolor_blend.c - graph_fillrect.c - graph_fillrect_amap.c - graph_fillrect_acolor.c - graph_rect.c - graph_copy.c - graph_copy_amap.c - graph_copy_bright.c - graph_copy_whiteout.c - graph_blend_amap.c - graph_blend_screen.c - graph_saturadd_amap.c - graph_draw_amap.c - graph_stretch.c - graph_cg.c - graph_buller.c - gre_blend_useamap.c - gre_blend.c - gre_blend_screen.c - ) - -add_library(alk STATIC alk.c) -target_compile_options(alk PRIVATE -Wno-pointer-sign) - -add_library(drawtext STATIC drawtext.c) -target_compile_options(drawtext PRIVATE -Wno-pointer-sign) - -add_library(list STATIC list.c) - -target_include_directories(graph PUBLIC .) -target_include_directories(alk PUBLIC .) -target_include_directories(drawtext PUBLIC .) -target_include_directories(list PUBLIC .) - -add_executable(lib_test list_test.c) -target_link_libraries(lib_test PRIVATE list) -add_test(NAME lib_test COMMAND lib_test)