feat(Cmake): Rewrite build and use inherited dependencies (#1652)

This commit is contained in:
Kargatum
2019-04-02 03:41:08 +07:00
committed by Francesco Borzì
parent 0f174eff01
commit eae9affec9
48 changed files with 6336 additions and 1178 deletions
+13 -2
View File
@@ -1,4 +1,4 @@
# Copyright (C)
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -8,4 +8,15 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
add_subdirectory(ace)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_subdirectory(ace)
else()
add_library(ace SHARED IMPORTED GLOBAL)
set_target_properties(ace
PROPERTIES
IMPORTED_LOCATION
"${ACE_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES
"${ACE_INCLUDE_DIR}")
endif()
+14 -13
View File
@@ -323,33 +323,34 @@ set(ace_STAT_SRCS
)
if (USE_COREPCH)
set(ace_PCH_HDR PrecompiledHeaders/WinAcePCH.h)
set(ace_PCH_SRC PrecompiledHeaders/WinAcePCH.cpp)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/WinAcePCH.h)
endif()
include_directories(
${CMAKE_SOURCE_DIR}/deps/acelite
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders
${CMAKE_SOURCE_DIR}/deps/zlib
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(ace SHARED
${ace_STAT_SRCS}
)
target_include_directories(ace
PUBLIC
${CMAKE_SOURCE_DIR}/deps/acelite
PRIVATE
${CMAKE_SOURCE_DIR}/deps/zlib)
# Needed for PCH support
set_source_files_properties(Atomic_Op_Sparc.c Rtems_init.c PROPERTIES LANGUAGE CXX)
add_definitions(-DACE_BUILD_DLL)
add_library(ace SHARED
${ace_STAT_SRCS}
${ace_PCH_SRC}
)
if (MINGW) # GCC ignores "#prama comment"
target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock)
endif()
# Generate precompiled header
if( USE_COREPCH )
add_cxx_pch(ace ${ace_PCH_HDR} ${ace_PCH_SRC})
if(USE_COREPCH)
add_cxx_pch(ace ${PRIVATE_PCH_HEADER})
endif()
install(TARGETS ace RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}")
-3
View File
@@ -1,3 +0,0 @@
#include "WinAcePCH.h"