mirror of
https://github.com/kakwa/uts-server
synced 2025-01-09 13:14:31 +01:00
add some dynamic optional linkage for FreeBSD on gcc_s
This commit is contained in:
parent
4abe7a0f3d
commit
e701cd7211
@ -10,6 +10,7 @@ option(BUNDLE_CIVETWEB "bundle civetweb with uts-server" OFF)
|
||||
|
||||
option(STATIC "static linked binary" OFF)
|
||||
option(LINKDL "dynamicaly link dl" OFF)
|
||||
option(LINKDL "dynamicaly link gcc_s" OFF)
|
||||
|
||||
IF(STATIC)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
@ -24,6 +25,10 @@ IF(LINK_DL)
|
||||
set(DL_LIBRARIES 'dl')
|
||||
ENDIF(LINK_DL)
|
||||
|
||||
IF(LINK_GCC_S)
|
||||
set(GCC_S_LIBRARIES 'gcc_s')
|
||||
ENDIF(LINK_GCC_S)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700")
|
||||
|
||||
if(DEBUG)
|
||||
@ -104,6 +109,7 @@ target_link_libraries(uts-server
|
||||
${LIBCIVETWEB_LIBRARIES}
|
||||
${ARGP_LIBRARIES}
|
||||
${DL_LIBRARIES}
|
||||
${GCC_S_LIBRARIES}
|
||||
)
|
||||
|
||||
INSTALL(TARGETS uts-server
|
||||
|
@ -38,11 +38,8 @@ uts-server is compiled using cmake:
|
||||
$ make
|
||||
|
||||
# Compile statically
|
||||
$ cmake . -DSTATIC=ON
|
||||
$ make
|
||||
|
||||
# Sometimes it might be necessary to link against glibc/dl.
|
||||
# In that case, the resulting binary is only partially static,
|
||||
# but it's not possible to do better than that.
|
||||
$ cmake . -DSTATIC=ON -DLINK_DL=ON
|
||||
# (in some cases, it might be necessary to still
|
||||
# link some libraries like dl or gcc_s, if necessary,
|
||||
# add -DDL_LINK=ON and/or -DGCC_S_LINK=ON)
|
||||
$ cmake . -DSTATIC=ON # -DDL_LINK=ON -DGCC_S_LINK=ON
|
||||
$ make
|
||||
|
Loading…
x
Reference in New Issue
Block a user