Use runtime linking and use standard variables
This commit is contained in:
parent
3a9bf01282
commit
6ff144f881
|
@ -1,3 +0,0 @@
|
||||||
[submodule "lib/uIRC"]
|
|
||||||
path = lib/uIRC
|
|
||||||
url = https://git.redxen.eu/caskd/uIRC
|
|
|
@ -1,26 +1,26 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(microircd LANGUAGES C)
|
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)
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
endif()
|
endif()
|
||||||
if (CMAKE_BUILD_TYPE EQUAL "Debug")
|
if (CMAKE_BUILD_TYPE EQUAL "Debug")
|
||||||
set(CFLAGS "${CFLAGS} -Og")
|
set(COMPILE_OPTIONS "${COMPILE_OPTIONS} -Og")
|
||||||
elseif (CMAKE_BUILD_TYPE EQUAL "Release")
|
elseif (CMAKE_BUILD_TYPE EQUAL "Release")
|
||||||
set(CFLAGS "${CFLAGS} -O2 -Werror")
|
set(COMPILE_OPTIONS "${COMPILE_OPTIONS} -O2 -Werror")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BUILD_HELPERS TRUE)
|
set(BUILD_HELPERS TRUE)
|
||||||
#set(IRCV3 TRUE)
|
#set(IRCV3 TRUE)
|
||||||
add_subdirectory(lib/uIRC)
|
|
||||||
add_executable(uircd
|
add_executable(uircd
|
||||||
src/main.c
|
src/main.c
|
||||||
src/net.c
|
src/net.c
|
||||||
src/filesystem.c
|
src/filesystem.c
|
||||||
src/misc.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)
|
set_property(TARGET uircd PROPERTY C_STANDARD 99)
|
||||||
|
|
||||||
install(TARGETS uircd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS uircd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
1
lib/uIRC
1
lib/uIRC
|
@ -1 +0,0 @@
|
||||||
Subproject commit 93e8a5b2a5632b25e9e11f7e0f8e4a12780d7cc9
|
|
Reference in New Issue