From 333b8e5159ada2f1b8cbfd1dd8eb9072754477d7 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 9 Nov 2012 13:13:45 +0100 Subject: Core/Build: Enable Clang PCH support and OS X specific features Core: Fix warnings here and there --- src/server/worldserver/CMakeLists.txt | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'src/server/worldserver') diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index eb5bb04d766..58167aad703 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -14,15 +14,9 @@ file(GLOB_RECURSE sources_TCSoap TCSoap/*.cpp TCSoap/*.h) file(GLOB_RECURSE sources_WorldThread WorldThread/*.cpp WorldThread/*.h) file(GLOB sources_localdir *.cpp *.h) -if( USE_COREPCH ) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) -endif() - -if ( USE_COREPCH AND MSVC ) - set(worldserver_SRCS - PrecompiledHeaders/worldPCH.cpp - PrecompiledHeaders/worldPCH.h - ) +if (USE_COREPCH) + set(worldserver_PCH_HDR PrecompiledHeaders/worldPCH.h) + set(worldserver_PCH_SRC PrecompiledHeaders/worldPCH.cpp) endif() set(worldserver_SRCS @@ -143,17 +137,21 @@ include_directories( ${OPENSSL_INCLUDE_DIR} ) -set(worldserver_LINK_FLAGS "") - -add_executable(worldserver ${worldserver_SRCS}) +add_executable(worldserver + ${worldserver_SRCS} + ${worldserver_PCH_SRC} +) if( NOT WIN32 ) - add_definitions(-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/worldserver.conf"') + set_target_properties(worldserver PROPERTIES + COMPILE_DEFINITIONS _TRINITY_CORE_CONFIG="${CONF_DIR}/worldserver.conf" + ) endif() add_dependencies(worldserver revision.h) -if( UNIX ) + +if( UNIX AND NOT NOJEM ) set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}") endif() @@ -172,9 +170,7 @@ target_link_libraries(worldserver ${ACE_LIBRARY} ${MYSQL_LIBRARY} ${OPENSSL_LIBRARIES} - ${OPENSSL_EXTRA_LIBRARIES} ${ZLIB_LIBRARIES} - ${OSX_LIBS} ) if( WIN32 ) @@ -194,9 +190,5 @@ endif() # Generate precompiled header if( USE_COREPCH ) - if(CMAKE_COMPILER_IS_GNUCXX) - add_precompiled_header(worldserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/worldPCH.h) - elseif(MSVC) - add_native_precompiled_header(worldserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/worldPCH) - endif() + add_cxx_pch(worldserver ${worldserver_PCH_HDR} ${worldserver_PCH_SRC}) endif() -- cgit v1.2.3