This repository has been archived on 2021-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
uIRCd/CMakeLists.txt

33 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.16)
project(microircd LANGUAGES C)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wall -Wextra -Wformat-overflow=2 -Wformat-security -Winit-self -Wstrict-overflow=2 -Wstringop-overflow=2 -Walloc-zero -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wfloat-equal -Wshadow -Wunsafe-loop-optimizations -Wparentheses -pedantic -fanalyzer -fstack-check)
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Weverything -pedantic -Wno-padded -Wno-disabled-macro-expansion)
endif()
OPTION(CMAKE_BUILD_TYPE "Debug")
if (CMAKE_BUILD_TYPE EQUAL "Debug")
add_compile_options(-Og)
elseif (CMAKE_BUILD_TYPE EQUAL "Release")
add_compile_options(-O2 -Werror)
endif()
add_executable(uircd
src/main.c
src/net.c
src/filesystem.c
src/misc.c
src/log.c
src/parsers.c
src/conns.c
)
find_library(UIRC_PATH NAMES uirc libuirc REQUIRED)
find_library(LIBCONFIG_PATH NAMES config libconfig REQUIRED)
target_link_libraries(uircd ${UIRC_PATH} ${LIBCONFIG_PATH})
set_property(TARGET uircd PROPERTY C_STANDARD 99)
install(TARGETS uircd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})