aboutsummaryrefslogtreecommitdiff
path: root/client/libacron/CMakeLists.txt
blob: ca9960e86e25a819fe82f051bdfda606977b48d2 (plain)
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
cmake_minimum_required(VERSION 3.22)
project(libac C)

set(CMAKE_C_STANDARD 11)

set(CMAKE_C_FLAGS_DEBUG
        "${CMAKE_C_FLAGS_DEBUG} -g3 -O0 -fsanitize=address -DDEBUG")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
        "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fsanitize=address")
add_definitions(-D_POSIX_C_SOURCE=200809L)

set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-Wl,--version-script='${CMAKE_SOURCE_DIR}/export.map'")

find_package(PkgConfig)
pkg_check_modules(json-c REQUIRED json-c)
add_library(ac SHARED
        include/libac.h
        include/events.h
        include/requests.h
        include/common.h
        include/net.h
        include/ids.h
        private/config.h
        private/serializer.c
        private/helpers.h
        private/helpers.c
        private/serializer.h
        private/log.c
        private/log.h
        private/connection.h
        wic/include/http_parser.h
        wic/include/wic.h
        wic/src/http_parser.c
        wic/src/wic.c
        net.c
        ids.c
        library.c
        )
target_include_directories(ac PUBLIC "${PROJECT_BINARY_DIR}" include/ private/ wic/include/)
target_link_libraries(ac json-c)

add_executable(acronc
        acronc/main.c
        )
target_link_libraries(acronc ac)
target_include_directories(acronc PUBLIC "${PROJECT_BINARY_DIR}" include/)