# 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 .)