aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 21efb39b4f55e590c0da91216b15dfcd6e882735 (plain) (blame)
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
cmake_minimum_required(VERSION 3.20)
project(do C)

set(CMAKE_C_STANDARD 99)
set(ASAN "Enable address analyzer" OFF)
add_compile_definitions(_GNU_SOURCE)

if (ASAN)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address \
        -fsanitize-recover=address \
        -fsanitize-address-use-after-scope \
        -fno-omit-frame-pointer \
        -fno-inline \
        -g -O0"
    )

    add_link_options(-fsanitize=address)
endif()

add_executable(do main.c
        str.c
        str.h
        targetlist.c
        targetlist.h
        common.h
        target.c
        target.h)