From 18893127524d87e47a948b9a92d8d8b2ab869852 Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 28 Dec 2023 00:04:20 +0300 Subject: WIP --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b0a77a..40a1814 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,15 +33,40 @@ set(compile_flags -Wcast-align -Wshadow ) +set(compile_definitions + $<$:_FORTIFY_SOURCE=2> + LOG_ERROR=1 + LOG_WARNING=1 + LOG_INFO=1 + $<$:LOG_DEBUG=1> + $<$:LOG_TRACE=0> + $<$>:LOG_DEBUG=0> + $<$>:LOG_TRACE=0> + ) + +add_library(timespec OBJECT lib/timespec/timespec.c lib/timespec/timespec.h) +target_compile_options(timespec PRIVATE ${compile_flags}) +target_compile_definitions(timespec PRIVATE ${compile_definitions}) +target_link_options(timespec PRIVATE $<$:${common_debug_flags}>) + +add_library(common OBJECT + proto.c + proto.h + proto_io.c + proto_io.h + ) +target_compile_options(common PRIVATE ${compile_flags}) +target_compile_definitions(common PRIVATE ${compile_definitions}) +target_link_options(common PRIVATE $<$:${common_debug_flags}>) -add_executable(server server.c) +add_executable(server server.c $ $) target_compile_options(server PRIVATE ${compile_flags}) -target_compile_definitions(server PRIVATE $<$:_FORTIFY_SOURCE=2>) +target_compile_definitions(server PRIVATE ${compile_definitions}) target_link_options(server PRIVATE $<$:${common_debug_flags}>) -target_include_directories(server PRIVATE .) +target_include_directories(server PRIVATE . lib) -add_executable(client client.c) +add_executable(client client.c $ $) target_compile_options(client PRIVATE ${compile_flags}) -target_compile_definitions(client PRIVATE $<$:_FORTIFY_SOURCE=2>) +target_compile_definitions(client PRIVATE ${compile_definitions}) target_link_options(client PRIVATE $<$:${common_debug_flags}>) -target_include_directories(client PRIVATE .) +target_include_directories(client PRIVATE . lib) -- cgit v1.2.3