summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/CMakeLists.txt4
2 files changed, 5 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 770a7d1ce..0249d831e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a51bc3057..a00c53d98 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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