From 0b86520b9ff166cd285d077d3d8192653e7d95e9 Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 7 Dec 2023 00:08:57 +0300 Subject: Initial commit --- CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 CMakeLists.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ec05a85 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: Unlicense + +cmake_minimum_required(VERSION 3.16) + +set(CMAKE_EXPORT_COMPILE_COMMANDS True) + +project(udp-tinkering) + +set(common_debug_flags + -g3 + -fsanitize=address,undefined + -fno-omit-frame-pointer + -O1 + ) +set(compile_flags + $<$:${common_debug_flags}> + $<$:-Wno-nested-anon-types> + $<$:-fno-exceptions> + $<$:-fno-rtti> + $<$:-Wold-style-cast> + $<$:-Wsuggest-override> + $<$:-Wsuggest-final-types> + $<$:-Wsuggest-final-methods> + $<$:-fstrict-volatile-bitfields> + $<$:-fstrict-volatile-bitfields> + $<$:-Wlogical-op> + $<$:-Wlogical-op> + $<$:-ffile-prefix-map=${CMAKE_SOURCE_DIR}/=> + $<$:-ffile-prefix-map=${CMAKE_SOURCE_DIR}/=> + -Wall + -Wextra + -pedantic + -Wcast-align + -Wshadow + ) + +add_executable(server server.c) +target_compile_options(server PRIVATE ${compile_flags}) +target_compile_definitions(server PRIVATE _FORTIFY_SOURCE=2) +target_link_options(server PRIVATE $<$:${common_debug_flags}>) +target_include_directories(server PRIVATE .) + +add_executable(client client.c) +target_compile_options(client PRIVATE ${compile_flags}) +target_compile_definitions(client PRIVATE _FORTIFY_SOURCE=2) +target_link_options(client PRIVATE $<$:${common_debug_flags}>) +target_include_directories(client PRIVATE .) -- cgit v1.2.3