diff options
author | Naram Qashat <cyberbotx@cyberbotx.com> | 2011-11-20 16:09:59 -0500 |
---|---|---|
committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2011-11-20 16:09:59 -0500 |
commit | bf8e4ac71484cfe30bcddd02cb91900875dc34b2 (patch) | |
tree | 542b131260c6ffd38a98d1ce28a67ff892840c8b | |
parent | 781ed11ba82dddac72976bd271adc44314a0221f (diff) |
Attempt to fix where link libraries are set when compiling to fix failed builds on systems that require -ldl.
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 |
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 |