refactor: move trie back to own static library

generic-data-trie
Jef Roosens 2022-12-07 10:57:58 +01:00
parent a6e7b1dfd3
commit 2a373f3841
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
10 changed files with 14 additions and 5 deletions

View File

@ -4,16 +4,17 @@ project(lander C CXX)
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
include_directories(crow/include include)
include_directories(crow/include trie/include)
add_subdirectory(crow)
add_subdirectory(trie)
if(CMAKE_BUILD_TYPE MATCHES "^Test")
enable_testing()
add_subdirectory(test)
else()
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_compile_options(-O3 -flto)
endif()
add_executable(lander src/main.cpp src/trie/trie.c)
add_executable(lander src/main.cpp)
target_link_libraries(lander PUBLIC trie)
endif()

View File

@ -0,0 +1,8 @@
include_directories(include)
if(CMAKE_BUILD_TYPE MATCHES "^Test")
enable_testing()
add_subdirectory(test)
endif()
add_library(trie STATIC include/trie.h src/trie.c)

View File

@ -1,6 +1,6 @@
add_compile_options(-Wno-incompatible-pointer-types)
add_executable(test_trie test_trie.c ../src/trie/trie.c)
add_executable(test_trie test_trie.c ../src/trie.c)
add_test(NAME test_trie COMMAND test_trie)
add_executable(test_trie_fuzzy test_trie_fuzzy.c ../src/trie/trie.c)
add_executable(test_trie_fuzzy test_trie_fuzzy.c ../src/trie.c)
add_test(NAME test_trie_fuzzy COMMAND test_trie_fuzzy)