diff options
| author | click <none@none> | 2010-08-16 12:14:10 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-08-16 12:14:10 +0200 |
| commit | 105e4e16cc1475468d51cae37aa3362b1d36f9e6 (patch) | |
| tree | 34b1c882b211644f0aaee1c4dce88fc1831cf06c /src/server/shared | |
| parent | 29c2520506e12bbae669fbd190901443eca2f2a5 (diff) | |
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
Diffstat (limited to 'src/server/shared')
| -rw-r--r-- | src/server/shared/CMakeLists.txt | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 7768d890cf5..de54145b141 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -8,6 +8,10 @@ # 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_Configuration Configuration/*.cpp Configuration/*.h) file(GLOB_RECURSE sources_Cryptography Cryptography/*.cpp Cryptography/*.h) file(GLOB_RECURSE sources_Database Database/*.cpp Database/*.h) @@ -24,7 +28,15 @@ file(GLOB sources_localdir *.cpp *.h) # Build shared sourcelist # +if( GAMEPCH AND MSVC ) + set(shared_STAT_SRCS + PrecompiledHeaders/sharedPCH.cpp + PrecompiledHeaders/sharedPCH.h + ) +endif() + set(shared_STAT_SRCS + ${shared_STAT_SRCS} ${sources_Configuration} ${sources_Cryptography} ${sources_Database} @@ -62,7 +74,6 @@ include_directories( ${OPENSSL_INCLUDE_DIR} ) - add_library(shared STATIC ${shared_STAT_SRCS}) add_dependencies(shared genrev) @@ -76,3 +87,13 @@ else() ${ACE_LIBRARY} ) endif() + +# Generate precompiled header +if( GAMEPCH ) + if(CMAKE_COMPILER_IS_GNUCXX) + add_precompiled_header(shared ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/sharedPCH.h) + elseif(MSVC) + add_native_precompiled_header(shared ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/sharedPCH) + endif() +endif() + |
