- Do use CMAKE_DL_LIBS to determine the linkerflags needed to link against libdl.

- For !WINDOWS, add sys_defines based on compiler instead based on system. (enabled compilation e.g on hurd and kfreebsd)
This commit is contained in:
Tobias Frost 2015-06-21 16:52:56 +02:00
parent a60f92b81b
commit 92dab63c30
2 changed files with 7 additions and 6 deletions

View file

@ -1404,6 +1404,7 @@ if(MSVC)
${PNG_LIBRARY}
${JPEG_LIBRARY}
${GLEW_LIBRARY}
${CMAKE_DL_LIBS}
)
#CMAKE_BINARY_DIR
@ -1552,15 +1553,10 @@ else()
set(RT_LIBRARY rt)
endif()
if(NOT "${CMAKE_SYSTEM}" MATCHES "FreeBSD")
set(DL_LIBRARY dl)
endif()
target_link_libraries(RBDoom3BFG
idlib
${OPENGL_LIBRARIES}
pthread
${DL_LIBRARY}
${RT_LIBRARY}
${SDLx_LIBRARY}
${OPENAL_LIBRARY}
@ -1569,6 +1565,7 @@ else()
${PNG_LIBRARY}
${JPEG_LIBRARY}
${GLEW_LIBRARY}
${CMAKE_DL_LIBS}
)
endif()

View file

@ -102,7 +102,7 @@ If you have questions concerning this license or the applicable additional terms
#endif
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__GNUC__) || defined(__clang__)
#if defined(__i386__)
#define CPUSTRING "x86"
@ -116,6 +116,8 @@ If you have questions concerning this license or the applicable additional terms
#define BUILD_STRING "linux-" CPUSTRING
#elif defined(__APPLE__)
#define BUILD_STRING "osx-" CPUSTRING
#else
#define BUILD_STRING "other-" CPUSTRING
#endif
#define _alloca alloca
@ -146,6 +148,8 @@ If you have questions concerning this license or the applicable additional terms
#define CALLBACK
#define __cdecl
#else
#error unknown build enviorment
#endif
// RB end