aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/CMakeLists.txt12
-rw-r--r--src/game/pchlinux.cpp1
-rw-r--r--src/game/pchlinux.h12
-rw-r--r--src/scripts/CMakeLists.txt14
4 files changed, 33 insertions, 6 deletions
diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt
index 68913a6d2d2..ab5ef6c2f56 100644
--- a/src/game/CMakeLists.txt
+++ b/src/game/CMakeLists.txt
@@ -1,5 +1,7 @@
-
-########### next target ###############
+# Enable precompiled headers when using the GCC compiler.
+IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
SET(game_STAT_SRCS
AccountMgr.cpp
@@ -317,6 +319,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/shared
${CMAKE_SOURCE_DIR}/src/shared/vmap
${CMAKE_SOURCE_DIR}/src/shared/Database
+ ${CMAKE_SOURCE_DIR}/src/game
${MYSQL_INCLUDE_DIR}
)
@@ -343,3 +346,8 @@ endif(NOT DO_SCRIPTS)
add_library(game STATIC ${game_STAT_SRCS})
ADD_DEPENDENCIES(game revision.h)
+# Generate precompiled header
+IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
+ ADD_PRECOMPILED_HEADER(game ${CMAKE_SOURCE_DIR}/src/game/pchlinux.h)
+ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
+
diff --git a/src/game/pchlinux.cpp b/src/game/pchlinux.cpp
new file mode 100644
index 00000000000..e588392689e
--- /dev/null
+++ b/src/game/pchlinux.cpp
@@ -0,0 +1 @@
+#include "pchdef.h" \ No newline at end of file
diff --git a/src/game/pchlinux.h b/src/game/pchlinux.h
new file mode 100644
index 00000000000..7252e980e7d
--- /dev/null
+++ b/src/game/pchlinux.h
@@ -0,0 +1,12 @@
+//add here most rarely modified headers to speed up debug build compilation
+#include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it
+#include "Common.h"
+
+#include "MapManager.h"
+#include "Log.h"
+#include "ObjectAccessor.h"
+#include "ObjectDefines.h"
+#include "Database/SQLStorage.h"
+#include "Opcodes.h"
+#include "SharedDefines.h"
+#include "ObjectMgr.h"
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt
index 54627091ec2..e51130881f6 100644
--- a/src/scripts/CMakeLists.txt
+++ b/src/scripts/CMakeLists.txt
@@ -1,11 +1,13 @@
-
-########### next target ###############
+# Enable precompiled headers when using the GCC compiler.
+IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
SET(scripts_STAT_SRCS
- ../game/ScriptedEscortAI.cpp
- ../game/ScriptedEscortAI.h
../game/ScriptedPch.cpp
../game/ScriptedPch.h
+ ../game/ScriptedEscortAI.cpp
+ ../game/ScriptedEscortAI.h
../game/ScriptedCreature.cpp
../game/ScriptedCreature.h
../game/ScriptedFollowerAI.cpp
@@ -586,3 +588,7 @@ include_directories(
add_library(scripts STATIC ${scripts_STAT_SRCS})
+# Generate precompiled header
+IF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
+ ADD_PRECOMPILED_HEADER(scripts ${CMAKE_SOURCE_DIR}/src/game/ScriptedPch.h)
+ENDIF(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)