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:
@@ -44,7 +44,9 @@ add_executable(authserver
|
||||
|
||||
add_dependencies(authserver revision.h)
|
||||
|
||||
add_definitions(-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"')
|
||||
if(NOT WIN32)
|
||||
add_definitions(-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"')
|
||||
endif()
|
||||
|
||||
set(authserver_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}")
|
||||
|
||||
@@ -54,6 +56,18 @@ endif()
|
||||
|
||||
set_target_properties(authserver PROPERTIES LINK_FLAGS "${authserver_LINK_FLAGS}")
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(
|
||||
authserver
|
||||
shared
|
||||
trinitydatabase
|
||||
trinityauth
|
||||
trinityconfig
|
||||
${MYSQL_LIBRARY}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${OPENSSL_EXTRA_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
authserver
|
||||
shared
|
||||
@@ -64,7 +78,7 @@ target_link_libraries(
|
||||
${OPENSSL_LIBRARIES}
|
||||
${OSX_LIBS}
|
||||
)
|
||||
|
||||
endif()
|
||||
########### install files ###############
|
||||
|
||||
install(TARGETS authserver DESTINATION bin)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
######## game ########
|
||||
|
||||
# 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()
|
||||
|
||||
@@ -279,11 +279,22 @@ if(NOT DO_SCRIPTS)
|
||||
message("-- Added basic scriptAI-engines to GAME library")
|
||||
endif()
|
||||
|
||||
# Add gamePCH.cpp to project on Windows
|
||||
if(MSVC)
|
||||
set(game_STAT_SRCS
|
||||
PrecompiledHeaders/gamePCH.cpp
|
||||
${game_STAT_SRCS})
|
||||
endif()
|
||||
|
||||
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/server/game/PrecompiledHeaders/NixCorePCH.h)
|
||||
if(DO_PCH)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_precompiled_header(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/gamePCH.h)
|
||||
elseif(MSVC)
|
||||
add_native_precompiled_header(game ${CMAKE_SOURCE_DIR}/src/server/game/PrecompiledHeaders/gamePCH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "NixCorePCH.h"
|
||||
@@ -1 +0,0 @@
|
||||
#include "WinCorePCH.h"
|
||||
@@ -1,14 +0,0 @@
|
||||
//add here most rarely modified headers to speed up debug build compilation
|
||||
#include "..\Server\WorldSocket.h" // must be first to make ACE happy with ACE includes in it
|
||||
#include "..\..\shared\Common.h"
|
||||
|
||||
#include "..\Maps\MapManager.h"
|
||||
#include "..\..\shared\Logging\Log.h"
|
||||
#include "..\Globals\ObjectAccessor.h"
|
||||
#include "..\Entities\Object\ObjectDefines.h"
|
||||
#include "..\..\shared\Database/SQLStorage.h"
|
||||
#include "..\Protocol\Opcodes.h"
|
||||
#include "..\Miscellaneous\SharedDefines.h"
|
||||
#include "..\Globals\ObjectMgr.h"
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
@@ -0,0 +1 @@
|
||||
#include "gamePCH.h"
|
||||
@@ -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()
|
||||
|
||||
@@ -20,6 +20,15 @@ set(shared_STAT_SRCS
|
||||
Common.cpp
|
||||
)
|
||||
|
||||
# Windows specific files
|
||||
if(WIN32)
|
||||
set(shared_STAT_SRCS
|
||||
${shared_STAT_SRCS}
|
||||
Debugging/WheatyExceptionReport.cpp
|
||||
Utilities/ServiceWin32.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${ACE_INCLUDE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
@@ -43,10 +52,17 @@ include_directories(
|
||||
|
||||
add_library(shared STATIC ${shared_STAT_SRCS})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(
|
||||
shared
|
||||
ace
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
shared
|
||||
${ACE_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
########### trinityconfig ###############
|
||||
|
||||
|
||||
@@ -118,9 +118,9 @@ include_directories(
|
||||
set(worldserver_LINK_FLAGS "")
|
||||
|
||||
add_executable(worldserver ${worldserver_SRCS})
|
||||
add_definitions(
|
||||
-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/worldserver.conf"'
|
||||
)
|
||||
if(NOT WIN32)
|
||||
add_definitions(-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/worldserver.conf"')
|
||||
endif()
|
||||
|
||||
add_dependencies(worldserver revision.h)
|
||||
|
||||
@@ -152,11 +152,11 @@ if(WIN32)
|
||||
trinityconfig
|
||||
collision
|
||||
g3dlib
|
||||
jemalloc
|
||||
${SCRIPT_LIB}
|
||||
${ACE_LIBRARY}
|
||||
ace
|
||||
${MYSQL_LIBRARY}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${OPENSSL_EXTRA_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
|
||||
Reference in New Issue
Block a user