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
This commit is contained in:
click
2010-08-16 12:14:10 +02:00
parent 29c2520506
commit 105e4e16cc
8 changed files with 112 additions and 23 deletions
+21
View File
@@ -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()