~donmcc/ood

ood/CMakeLists.txt -rw-r--r-- 980 bytes
2cad5cb5Don McCaughey Add `ood_ptr_array_append()` function. 28 days ago
                                                                                
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
cmake_minimum_required(VERSION 3.13...3.22)
project(ood
        VERSION 0.0.1
        DESCRIPTION "Ood RSS Reader"
        HOMEPAGE_URL https://github.com/donmccaughey/ood
        LANGUAGES C
        )
set(CMAKE_C_STANDARD 99)
enable_testing()


# ----- configuration options -----

option(ADDRESS_SANITIZER "Enable the address sanitizer")
if(ADDRESS_SANITIZER)
    add_compile_options(-fsanitize=address -g)
    add_link_options(-fsanitize=address)
endif()

option(COVERAGE "Enable code coverage analysis")
if(COVERAGE)
    add_compile_options(--coverage -g -O0)
    add_link_options(--coverage)
endif()

option(WALL "Enable all warnings")
if(WALL)
    add_compile_options(-Wall -Werror)
endif()


# ----- compatibility checks -----

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
    # make asprintf() visible
    add_definitions(-D_GNU_SOURCE)
endif()


# ----- add build files in subdirectories -----

add_subdirectory(src/libood)
add_subdirectory(src/ood)
add_subdirectory(src/dood)