-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (47 loc) · 2.07 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cmake_minimum_required(VERSION 3.8)
project(ceeds)
set(CMAKE_C_STANDARD 11)
set(PREPROCESSOR_FLAGS "-D_GNU_SOURCE -D__FILENAME__=\"$(<F)\"")
set(WARNING_FLAGS "-Wall -Wextra -Wundef -Wshadow -Wpointer-arith")
set(OPTIMIZATION_FLAGS "-O3")
set(CMAKE_C_FLAGS "${PREPROCESSOR_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
add_library(ceeds INTERFACE)
target_sources(ceeds INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/ascii_set.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/binary_heap.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/bitmanip.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/core.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/growing_str.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/hash_map.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/hash_utils.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/list.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/memory.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/memory_allocator.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/str.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/string_utils.h
${CMAKE_CURRENT_SOURCE_DIR}/include/ceeds/vector.h
${CMAKE_CURRENT_SOURCE_DIR}/src/growing_str.c
${CMAKE_CURRENT_SOURCE_DIR}/src/hash_utils.c
${CMAKE_CURRENT_SOURCE_DIR}/src/memory.c
${CMAKE_CURRENT_SOURCE_DIR}/src/string_utils.c
)
target_include_directories(ceeds INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
option(CEEDS_BUILD_TESTS "Build tests of the ceeds library" ON)
if (CEEDS_BUILD_TESTS)
add_executable(ceeds-tests
tests/unit_tests.h
tests/ascii_set-tests.c
tests/binary_heap-tests.c
tests/bitmanip-tests.c
tests/core-tests.c
tests/growing_str-tests.c
tests/hash_map-tests.c
tests/list-tests.c
tests/memory-tests.c
tests/str-tests.c
tests/string_utils-tests.c
tests/vector-tests.c
tests/main.c
)
target_link_libraries(ceeds-tests PRIVATE ceeds)
endif ()