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
@@ -8,12 +8,24 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
if( GAMEPCH )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
file(GLOB_RECURSE sources_Management Management/*.cpp Management/*.h)
file(GLOB_RECURSE sources_Maps Maps/*.cpp Maps/*.h)
file(GLOB_RECURSE sources_Models Models/*.cpp Models/*.h)
file(GLOB sources_localdir *.cpp *.h)
if( GAMEPCH AND MSVC )
set(collision_STAT_SRCS
PrecompiledHeaders/collisionPCH.cpp
PrecompiledHeaders/collisionPCH.h
)
endif()
set(collision_STAT_SRCS
${collision_STAT_SRCS}
${sources_Management}
${sources_Maps}
${sources_Models}
@@ -37,3 +49,13 @@ include_directories(
)
add_library(collision STATIC ${collision_STAT_SRCS})
# Generate precompiled header
if( GAMEPCH )
if(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(collision ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/collisionPCH.h)
elseif(MSVC)
add_native_precompiled_header(collision ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/collisionPCH)
endif()
endif()