mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
fix cmake/ACE for freeBSD and Mac OSX
--HG-- branch : trunk
This commit is contained in:
@@ -136,6 +136,11 @@ endif(ACE_FOUND)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET(OSX_LIBS -lcrypto)
|
||||
add_definitions(-D__ASSERTMACROS__)
|
||||
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
|
||||
|
||||
add_definitions(--no-warnings) #to make build look nice, no gcc nazi warnings.
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
#define PATH_MAX 260
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE_CC__)
|
||||
#define lseek64 lseek
|
||||
#endif
|
||||
|
||||
#define LIBMPQ_MAJOR_VERSION 0 /* Major version number... maybe sometimes we reach version 1 :) */
|
||||
#define LIBMPQ_MINOR_VERSION 3 /* Minor version number - increased only for small changes */
|
||||
|
||||
@@ -125,7 +125,7 @@ ACE_OS::gethostbyaddr_r (const char *addr,
|
||||
*h_errnop = h_errno;
|
||||
return (struct hostent *) 0;
|
||||
}
|
||||
# elif defined (__GLIBC__)
|
||||
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||
// GNU C library has a different signature
|
||||
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
||||
|
||||
@@ -318,7 +318,7 @@ ACE_OS::gethostbyname_r (const char *name,
|
||||
*h_errnop = h_errno;
|
||||
return (struct hostent *) 0;
|
||||
}
|
||||
# elif defined (__GLIBC__)
|
||||
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||
// GNU C library has a different signature
|
||||
ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA));
|
||||
|
||||
@@ -528,7 +528,7 @@ ACE_OS::getprotobyname_r (const char *name,
|
||||
else
|
||||
return 0;
|
||||
//FUZZ: enable check_for_lack_ACE_OS
|
||||
# elif defined (__GLIBC__)
|
||||
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||
// GNU C library has a different signature
|
||||
//FUZZ: disable check_for_lack_ACE_OS
|
||||
if (::getprotobyname_r (name,
|
||||
@@ -609,7 +609,7 @@ ACE_OS::getprotobynumber_r (int proto,
|
||||
//FUZZ: enable check_for_lack_ACE_OS
|
||||
else
|
||||
return 0;
|
||||
# elif defined (__GLIBC__)
|
||||
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||
// GNU C library has a different signature
|
||||
//FUZZ: disable check_for_lack_ACE_OS
|
||||
if (::getprotobynumber_r (proto,
|
||||
@@ -695,7 +695,7 @@ ACE_OS::getservbyname_r (const char *svc,
|
||||
//FUZZ: enable check_for_lack_ACE_OS
|
||||
else
|
||||
return (struct servent *) 0;
|
||||
# elif defined (__GLIBC__)
|
||||
# elif defined (__GLIBC__) || defined (__FreeBSD__)
|
||||
// GNU C library has a different signature
|
||||
ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA));
|
||||
|
||||
|
||||
@@ -383,6 +383,10 @@ add_library(trinityscript SHARED ${trinityscript_LIB_SRCS})
|
||||
|
||||
add_definitions(-D_TRINITY_SCRIPT_CONFIG='"${CONF_DIR}/trinitycore.conf"')
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET_TARGET_PROPERTIES(trinityscript PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
|
||||
target_link_libraries(trinityscript)
|
||||
|
||||
set_target_properties(trinityscript PROPERTIES VERSION 4.2.0 SOVERSION 4)
|
||||
|
||||
@@ -60,8 +60,13 @@
|
||||
# else
|
||||
# define TRINITY_IMPORT __attribute__ ((cdecl))
|
||||
# endif //__APPLE_CC__ && BIG_ENDIAN
|
||||
# define TRINITY_SCRIPT_EXT ".so"
|
||||
# define TRINITY_SCRIPT_NAME "libtrinityscript"
|
||||
# if defined(__APPLE_CC__)
|
||||
# define TRINITY_SCRIPT_EXT ".dylib"
|
||||
# define TRINITY_SCRIPT_NAME "../lib/libtrinityscript"
|
||||
# else
|
||||
# define TRINITY_SCRIPT_EXT ".so"
|
||||
# define TRINITY_SCRIPT_NAME "libtrinityscript"
|
||||
# endif //__APPLE_CC__
|
||||
# define TRINITY_PATH_MAX PATH_MAX
|
||||
#endif //PLATFORM
|
||||
|
||||
|
||||
@@ -13,15 +13,23 @@ WorldRunnable.cpp
|
||||
WorldRunnable.h
|
||||
)
|
||||
|
||||
SET(trinity-core_LINK_FLAGS "")
|
||||
|
||||
add_executable(trinity-core ${trinity-core_SRCS})
|
||||
add_definitions(
|
||||
-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/trinitycore.conf"'
|
||||
)
|
||||
IF (DO_MYSQL)
|
||||
SET_TARGET_PROPERTIES(trinity-core PROPERTIES LINK_FLAGS "-pthread")
|
||||
SET(trinity-core_LINK_FLAGS "-pthread ${trinity-core_LINK_FLAGS}")
|
||||
ENDIF(DO_MYSQL)
|
||||
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET(trinity-core_LINK_FLAGS "-framework Carbon ${trinity-core_LINK_FLAGS}")
|
||||
SET(SCRIPT_LIB "")
|
||||
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
|
||||
SET_TARGET_PROPERTIES(trinity-core PROPERTIES LINK_FLAGS "${trinity-core_LINK_FLAGS}")
|
||||
|
||||
target_link_libraries(
|
||||
trinity-core
|
||||
@@ -42,6 +50,7 @@ ${POSTGRE_LIBS}
|
||||
${SSLLIB}
|
||||
${ACE_LIBRARY}
|
||||
${ZLIB}
|
||||
${OSX_LIBS}
|
||||
)
|
||||
|
||||
install(TARGETS trinity-core DESTINATION bin)
|
||||
|
||||
@@ -9,18 +9,24 @@ RealmList.cpp
|
||||
RealmList.h
|
||||
)
|
||||
|
||||
SET(trinity-realm_LINK_FLAGS "")
|
||||
|
||||
add_executable(trinity-realm ${trinity-realm_SRCS})
|
||||
add_definitions(
|
||||
-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/trinityrealm.conf"'
|
||||
)
|
||||
IF (DO_MYSQL)
|
||||
#SET_TARGET_PROPERTIES(mangos-realmd PROPERTIES LINK_FLAGS ${MYSQL_LIBS})
|
||||
SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "-pthread")
|
||||
SET(trinity-realm_LINK_FLAGS "-pthread ${trinity-realm_LINK_FLAGS}")
|
||||
ENDIF(DO_MYSQL)
|
||||
IF (DO_POSTGRE)
|
||||
SET_TARGET_PROPERTIES(trinity-realmd PROPERTIES LINK_FLAGS ${POSTGRE_LIBS})
|
||||
SET(trinity-realm_LINK_FLAGS "${POSTGRE_LIBS} ${trinity-realm_LINK_FLAGS}")
|
||||
ENDIF(DO_POSTGRE)
|
||||
|
||||
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET(trinity-realm_LINK_FLAGS "-framework Carbon ${trinity-realm_LINK_FLAGS}")
|
||||
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
|
||||
SET_TARGET_PROPERTIES(trinity-realm PROPERTIES LINK_FLAGS "${trinity-realm_LINK_FLAGS}")
|
||||
|
||||
target_link_libraries(
|
||||
trinity-realm
|
||||
@@ -34,11 +40,11 @@ ZThread
|
||||
zlib
|
||||
${SSLLIB}
|
||||
${MYSQL_LIBRARIES}
|
||||
${OSX_LIBS}
|
||||
)
|
||||
|
||||
install(TARGETS trinity-realm DESTINATION bin)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES trinityrealm.conf.dist DESTINATION etc)
|
||||
|
||||
Reference in New Issue
Block a user