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
+22
View File
@@ -15,7 +15,19 @@ file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h)
file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h)
file(GLOB sources_localdir *.cpp *.h)
if( GAMEPCH )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
if ( GAMEPCH AND MSVC )
set(authserver_SRCS
PrecompiledHeaders/authPCH.cpp
PrecompiledHeaders/authPCH.h
)
endif()
set(authserver_SRCS
${authserver_SRCS}
${sources_authentication}
${sources_realms}
${sources_server}
@@ -102,3 +114,13 @@ elseif( WIN32 )
install(TARGETS authserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(FILES authserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()
# Generate precompiled header
if( GAMEPCH )
if(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(authserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/authPCH.h)
elseif(MSVC)
add_native_precompiled_header(authserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/authPCH)
endif()
endif()