mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
It is now possible to use CMake on windows for proper build (PCH support included)
Merged PCH header into gamePCH since they became the same after these changes --HG-- branch : trunk rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
This commit is contained in:
@@ -16,15 +16,13 @@ file(GLOB_RECURSE scripts_world World/*.cpp)
|
||||
file(GLOB_RECURSE scripts_examples Examples/*.cpp)
|
||||
|
||||
# Enable precompiled headers when using the GCC compiler.
|
||||
if(DO_PCH AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(DO_PCH)
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(scripts_STAT_SRCS
|
||||
../game/PrecompiledHeaders/ScriptPCH.cpp
|
||||
../game/PrecompiledHeaders/ScriptPCH.h
|
||||
../game/AI/ScriptedAI/ScriptedEscortAI.cpp
|
||||
../game/AI/ScriptedAI/ScriptedCreature.cpp
|
||||
../game/AI/ScriptedAI/ScriptedFollowerAI.cpp
|
||||
@@ -125,11 +123,20 @@ include_directories(
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# Add ScriptPCH.cpp to project on Windows
|
||||
if(MSVC)
|
||||
set(scripts_STAT_SRCS
|
||||
../game/PrecompiledHeaders/ScriptPCH.cpp
|
||||
${scripts_STAT_SRCS})
|
||||
endif()
|
||||
|
||||
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/server/game/PrecompiledHeaders/ScriptPCH.h
|
||||
)
|
||||
if(DO_PCH)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_precompiled_header(scripts ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/ScriptPCH.h)
|
||||
elseif(MSVC)
|
||||
add_native_precompiled_header(scripts ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/ScriptPCH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user