From 105e4e16cc1475468d51cae37aa3362b1d36f9e6 Mon Sep 17 00:00:00 2001 From: click Date: Mon, 16 Aug 2010 12:14:10 +0200 Subject: Buildsystem: Add PCH-support for targets shared, collision, authserver and worldserver (your mileage may vary, feedback needed) - The active configuration for these to be active is GAMEPCH, so don't expect turbospeed if not enabled. --HG-- branch : trunk --- src/server/worldserver/CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/server/worldserver') diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index e322ec31eaa..54bb72266d7 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -14,7 +14,19 @@ 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( GAMEPCH ) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) +endif() + +if ( GAMEPCH AND MSVC ) + set(worldserver_SRCS + PrecompiledHeaders/worldPCH.cpp + PrecompiledHeaders/worldPCH.h + ) +endif() + set(worldserver_SRCS + ${worldserver_SRCS} ${sources_CommandLine} ${sources_RemoteAccess} ${sources_TCSoap} @@ -206,3 +218,12 @@ elseif( WIN32 ) install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}") install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}") endif() + +# Generate precompiled header +if( GAMEPCH ) + 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() +endif() -- cgit v1.2.3