diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e43a001 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.6) + +project(liblcthw) + +include_directories(${PROJECT_SOURCE_DIR}/src) + +add_subdirectory(src/lcthw) +add_subdirectory(tests) + diff --git a/src/lcthw/CMakeLists.txt b/src/lcthw/CMakeLists.txt new file mode 100644 index 0000000..865019a --- /dev/null +++ b/src/lcthw/CMakeLists.txt @@ -0,0 +1,4 @@ +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types -Wno-implicit-function-declaration") +aux_source_directory(. libsrc) +add_library(lcthw ${libsrc}) + diff --git a/src/lcthw/list_algos.c b/src/lcthw/list_algos.c index 045b94c..6afe905 100644 --- a/src/lcthw/list_algos.c +++ b/src/lcthw/list_algos.c @@ -1,7 +1,7 @@ #include #include -inline void ListNode_swap(ListNode * a, ListNode * b) +static inline void ListNode_swap(ListNode * a, ListNode * b) { void *temp = a->value; a->value = b->value; @@ -31,7 +31,7 @@ int List_bubble_sort(List * list, List_compare cmp) return 0; } -inline List *List_merge(List * left, List * right, List_compare cmp) +static inline List *List_merge(List * left, List * right, List_compare cmp) { List *result = List_create(); void *val = NULL; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..6acf242 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types -Wno-implicit-function-declaration") +aux_source_directory(. testsrc) +foreach(e ${testsrc}) + get_filename_component(n ${e} NAME_WE) + add_executable(${n} ${e}) + target_link_libraries(${n} lcthw bsd m) +endforeach(e) +