Use runtime linking and use standard variables

This commit is contained in:
Alex D. 2020-09-15 16:56:22 +02:00
parent 3a9bf01282
commit 6ff144f881
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
3 changed files with 5 additions and 9 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "lib/uIRC"]
path = lib/uIRC
url = https://git.redxen.eu/caskd/uIRC

View File

@ -1,26 +1,26 @@
cmake_minimum_required(VERSION 3.16)
project(microircd LANGUAGES C)
set(CFLAGS "${CFLAGS} -Wall -Wextra -pedantic -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 -fanalyzer -fstack-protector")
set(COMPILE_OPTIONS "-Wall -Wextra -pedantic -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 -fanalyzer -fstack-protector")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
if (CMAKE_BUILD_TYPE EQUAL "Debug")
set(CFLAGS "${CFLAGS} -Og")
set(COMPILE_OPTIONS "${COMPILE_OPTIONS} -Og")
elseif (CMAKE_BUILD_TYPE EQUAL "Release")
set(CFLAGS "${CFLAGS} -O2 -Werror")
set(COMPILE_OPTIONS "${COMPILE_OPTIONS} -O2 -Werror")
endif()
set(BUILD_HELPERS TRUE)
#set(IRCV3 TRUE)
add_subdirectory(lib/uIRC)
add_executable(uircd
src/main.c
src/net.c
src/filesystem.c
src/misc.c
)
target_link_libraries(uircd uirc)
find_library(UIRC_PATH NAMES uirc libuirc REQUIRED)
target_link_libraries(uircd ${UIRC_PATH})
set_property(TARGET uircd PROPERTY C_STANDARD 99)
install(TARGETS uircd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

@ -1 +0,0 @@
Subproject commit 93e8a5b2a5632b25e9e11f7e0f8e4a12780d7cc9