aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..b35984b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,35 @@
1cmake_minimum_required(VERSION 3.17.0)
2
3project(rssmail VERSION 1.0.0 LANGUAGES C)
4
5set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6
7find_package(LibXml2 REQUIRED)
8find_package(CURL REQUIRED)
9
10add_executable(rssmail
11 src/main.c
12 src/fetch.c
13 src/parse.c
14 src/mail.c
15 src/config.c
16 src/post.c)
17
18if(CMAKE_BUILD_TYPE STREQUAL "Debug")
19 target_compile_options(rssmail PRIVATE -ggdb3 -fsanitize=address -fsanitize=undefined)
20 target_link_options(rssmail PRIVATE -no-pie -fsanitize=address -fsanitize=undefined)
21 target_compile_definitions(rssmail PRIVATE DEBUG RSSMAIL_SEND_TO_FILE)
22endif()
23
24# disabling logging may reduce binary size
25# target_compile_definitions(rssmail PRIVATE RSSMAIL_DISABLE_LOGGING)
26
27target_link_libraries(rssmail
28 PRIVATE
29 ${LIBXML2_LIBRARIES}
30 ${CURL_LIBRARIES})
31target_include_directories(rssmail
32 PRIVATE
33 "${CMAKE_CURRENT_SOURCE_DIR}/include"
34 ${LIBXML2_INCLUDE_DIRS}
35 ${CURL_INCLUDE_DIRS})