mirror of
https://github.com/anope/anope.git
synced 2026-06-12 19:14:47 +02:00
Attempt to fix where link libraries are set when compiling to fix failed builds on systems that require -ldl.
This commit is contained in:
+3
-3
@@ -261,7 +261,7 @@ endif(MSVC)
|
||||
|
||||
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
|
||||
if(CMAKE_DL_LIBS)
|
||||
set(LDFLAGS "${LDFLAGS} -l${CMAKE_DL_LIBS}")
|
||||
set(LINK_LIBS "${LINK_LIBS} ${CMAKE_DL_LIBS}")
|
||||
endif(CMAKE_DL_LIBS)
|
||||
|
||||
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
|
||||
@@ -297,12 +297,12 @@ if(NOT MSVC)
|
||||
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
|
||||
if(HAVE_SOCKET_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lsocket")
|
||||
set(LINK_LIBS "${LINK_LIBS} socket")
|
||||
endif(HAVE_SOCKET_LIB)
|
||||
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
|
||||
if(HAVE_NSL_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lnsl")
|
||||
set(LINK_LIBS "${LINK_LIBS} nsl")
|
||||
endif(HAVE_NSL_LIB)
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
|
||||
+2
-2
@@ -93,11 +93,11 @@ add_executable(${PROGRAM_NAME} ${SRC_SRCS})
|
||||
set_target_properties(${PROGRAM_NAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" ENABLE_EXPORTS ON)
|
||||
# On Windows, also link Anope to the wsock32 and Ws2_32 library, as well as set the version
|
||||
if(WIN32)
|
||||
target_link_libraries(${PROGRAM_NAME} wsock32 Ws2_32 ${GETTEXT_LIBRARIES} ${WIN32_MEMORY})
|
||||
target_link_libraries(${PROGRAM_NAME} wsock32 Ws2_32 ${LINK_LIBS} ${GETTEXT_LIBRARIES} ${WIN32_MEMORY})
|
||||
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
|
||||
else(WIN32)
|
||||
if(GETTEXT_LIBRARIES)
|
||||
target_link_libraries(${PROGRAM_NAME} ${GETTEXT_LIBRARIES})
|
||||
target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS} ${GETTEXT_LIBRARIES})
|
||||
endif(GETTEXT_LIBRARIES)
|
||||
endif(WIN32)
|
||||
# Building the Anope executable requires the version.h header to be generated
|
||||
|
||||
Reference in New Issue
Block a user