Skip to content

Commit

Permalink
Core/Buildsystem: Add suport for vs2015
Browse files Browse the repository at this point in the history
Core/Dep: remove mysqllite dependency, now user MUST install mysql server to use included libs
Also remove lots of warnings in vs2015
  • Loading branch information
adrianrp1988 committed Dec 7, 2016
1 parent 834308c commit c9320ed
Show file tree
Hide file tree
Showing 303 changed files with 371 additions and 199,512 deletions.
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@
project(MopCore547)

# CMake policies (can not be handled elsewhere)
cmake_minimum_required(VERSION 2.6)
# We require CMake >= 3.0
cmake_minimum_required(VERSION 3.0)

cmake_policy(SET CMP0005 OLD)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
endif(POLICY CMP0043)

# build static libraries
set(BUILD_SHARED_LIBS OFF)

# Set RPATH-handing (CMake parameters)
set(CMAKE_SKIP_BUILD_RPATH 0)
Expand Down Expand Up @@ -51,19 +59,10 @@ endif()

include(CheckPlatform)

# basic packagesearching and setup (further support will be needed, this is a preliminary release!)
find_package(PCHSupport)
find_package(ACE REQUIRED)
find_package(MySQL REQUIRED)
find_package(OpenSSL REQUIRED)
if( NOT USE_MYSQL_SOURCES )
find_package(MySQL REQUIRED)
endif()

if( UNIX )
find_package(Readline)
find_package(ZLIB)
find_package(BZip2)
endif()

# Find revision ID and hash of the sourcetree
include(cmake/genrev.cmake)
Expand Down
13 changes: 4 additions & 9 deletions cmake/platform/win/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ option(USE_MYSQL_SOURCES "Use included MySQL-sources to build libraries" 1)
# Package overloads
set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/acelite)
set(ACE_LIBRARY "ace")
set(BZIP2_LIBRARIES "bzip2")
set(ZLIB_LIBRARIES "zlib")

if( USE_MYSQL_SOURCES )
set(MYSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/mysqllite/include)
set(MYSQL_LIBRARY "libmysql")
set( MYSQL_FOUND 1 )
message(STATUS "Using supplied MySQL sources")
endif()

# check the CMake preload parameters (commented out by default)

Expand All @@ -25,4 +16,8 @@ endif()
# endif()
#endif()

if (WIN32)
add_definitions(-D_WIN32_WINNT=0x0601)
endif()

include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
35 changes: 14 additions & 21 deletions dep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,30 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

if( CMAKE_COMPILER_IS_GNUCXX )
add_definitions(--no-warnings)
elseif( MSVC )
if( MSVC )
add_definitions(/W0)
else()
add_definitions(-w)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(SERVERS AND NOT NOJEM)
add_subdirectory(jemalloc)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if(SERVERS)
add_subdirectory(acelite)
if(USE_MYSQL_SOURCES)
add_subdirectory(mysqllite)
endif()
endif()
if(TOOLS)
add_subdirectory(bzip2)
endif()
if(SERVERS OR TOOLS)
add_subdirectory(threads)
add_subdirectory(zlib)
add_subdirectory(g3dlite)
add_subdirectory(jemalloc)
add_subdirectory(openssl)
add_subdirectory(mysql)
endif()

add_subdirectory(g3dlite)


if(SERVERS)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_subdirectory(acelite)
endif()
add_subdirectory(gsoap)
endif()

if(TOOLS)
add_subdirectory(StormLib)
add_subdirectory(bzip2)
endif()
2 changes: 1 addition & 1 deletion dep/acelite/ace/Time_Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ACE_Export ACE_Time_Value
explicit ACE_Time_Value (const struct timeval &t);

/// Construct the ACE_Time_Value object from a timespec_t.
explicit ACE_Time_Value (const timespec_t &t);
explicit ACE_Time_Value (const timespec &t);

/// Destructor
virtual ~ACE_Time_Value ();
Expand Down
30 changes: 30 additions & 0 deletions dep/acelite/ace/config-win32-msvc-11.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* -*- C++ -*- */
//=============================================================================
/**
* @file config-win32-msvc-11.h
*
* @brief Microsoft Visual C++ 11.0 configuration file.
*
* This file is the ACE configuration file for Microsoft Visual C++ version 11.
*
* @note Do not include this file directly, include config-win32.h instead.
*/
//=============================================================================

#ifndef ACE_CONFIG_WIN32_MSVC_11_H
#define ACE_CONFIG_WIN32_MSVC_11_H
#include /**/ "ace/pre.h"

#ifndef ACE_CONFIG_WIN32_H
#error Use config-win32.h in config.h instead of this header
#endif /* ACE_CONFIG_WIN32_H */

#ifndef ACE_WIN32_VC11
# define ACE_WIN32_VC11
#endif

// Until we have specific msvc11 settings, include the msvc10 file
#include "ace/config-win32-msvc-10.h"

#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_WIN32_MSVC_10_H */
30 changes: 30 additions & 0 deletions dep/acelite/ace/config-win32-msvc-12.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* -*- C++ -*- */
//=============================================================================
/**
* @file config-win32-msvc-12.h
*
* @brief Microsoft Visual C++ 12.0 configuration file.
*
* This file is the ACE configuration file for Microsoft Visual C++ version 12.
*
* @note Do not include this file directly, include config-win32.h instead.
*/
//=============================================================================

#ifndef ACE_CONFIG_WIN32_MSVC_12_H
#define ACE_CONFIG_WIN32_MSVC_12_H
#include /**/ "ace/pre.h"

#ifndef ACE_CONFIG_WIN32_H
#error Use config-win32.h in config.h instead of this header
#endif /* ACE_CONFIG_WIN32_H */

#ifndef ACE_WIN32_VC12
# define ACE_WIN32_VC12
#endif

// Until we have specific msvc12 settings, include the msvc11 file
#include "ace/config-win32-msvc-11.h"

#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_WIN32_MSVC_10_H */
45 changes: 45 additions & 0 deletions dep/acelite/ace/config-win32-msvc-14.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* -*- C++ -*- */
//=============================================================================
/**
* @file config-win32-msvc-14.h
*
* @brief Microsoft Visual C++ 14.0 configuration file.
*
* This file is the ACE configuration file for Microsoft Visual C++ version 2015.
*
* @note Do not include this file directly, include config-win32.h instead.
*/
//=============================================================================

#ifndef ACE_CONFIG_WIN32_MSVC_14_H
#define ACE_CONFIG_WIN32_MSVC_14_H
#include /**/ "ace/pre.h"

#ifndef ACE_CONFIG_WIN32_H
#error Use config-win32.h in config.h instead of this header
#endif /* ACE_CONFIG_WIN32_H */

#ifndef ACE_WIN32_VC14
# define ACE_WIN32_VC14
#endif

// Until we have specific msvc14 settings, include the msvc12 file
#include "ace/config-win32-msvc-12.h"

#define ACE_HAS_POSIX_TIME 1
#define ACE_LACKS_TIMESPEC_T 1

// According to MS the Visual Studio 2015 C-runtime has a
// C99 compliant vsnprintf/vsnwprintf, this is a change compared to
// previous versions
#define ACE_HAS_C99_VSNPRINTF
#define ACE_HAS_C99_VSNWPRINTF

// Visual Studio 2015 has 3 parameter wcstok
#define ACE_HAS_3_PARAM_WCSTOK

// Visual Studio 2015 has adequate C++11 support
#define ACE_HAS_CPP11

#include /**/ "ace/post.h"
#endif /* ACE_CONFIG_WIN32_MSVC_14_H */
8 changes: 7 additions & 1 deletion dep/acelite/ace/config-win32-msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@
#endif /* _WIN32_WCE */

//FUZZ: disable check_for_msc_ver
#if (_MSC_VER >= 1600)
#if (_MSC_VER >= 1900)
#include "ace/config-win32-msvc-14.h"
#elif (_MSC_VER >= 1800)
#include "ace/config-win32-msvc-12.h"
#elif (_MSC_VER >= 1700)
# include "ace/config-win32-msvc-11.h"
#elif (_MSC_VER >= 1600)
# include "ace/config-win32-msvc-10.h"
#elif (_MSC_VER >= 1500)
# include "ace/config-win32-msvc-9.h"
Expand Down
4 changes: 4 additions & 0 deletions dep/acelite/ace/os_include/os_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ typedef struct timespec
# endif
# endif /* !ACE_HAS_POSIX_TIME */

#if _MSC_VER >= 1900 // Visual Studio 2015
typedef timespec timespec_t;
#endif

# if defined(ACE_LACKS_TIMESPEC_T)
typedef struct timespec timespec_t;
# endif /* ACE_LACKS_TIMESPEC_T */
Expand Down
35 changes: 25 additions & 10 deletions dep/bzip2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
Expand All @@ -8,15 +8,30 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

file(GLOB sources *.c)
if(UNIX)
# Look for an installed bzip2 on unix
find_package(BZip2 REQUIRED)

set(bzip2_STAT_SRCS
${sources}
)
add_library(bzip2 SHARED IMPORTED GLOBAL)

include_directories(
${CMAKE_SOURCE_DIR}/dep/zlib
${CMAKE_CURRENT_SOURCE_DIR}
)
set_target_properties(bzip2
PROPERTIES
IMPORTED_LOCATION
"${BZIP2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES
"${BZIP2_INCLUDE_DIRS}")
else()
# Use the bundled source on windows
file(GLOB sources *.c)
add_library(bzip2 STATIC
${sources})

add_library(bzip2 STATIC ${bzip2_STAT_SRCS})
target_include_directories(bzip2
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR})

set_target_properties(bzip2
PROPERTIES
FOLDER
"dep")
endif()
24 changes: 12 additions & 12 deletions dep/g3dlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ set(g3dlib_STAT_SRCS
source/Vector4.cpp
)

if(WIN32)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/dep/zlib
)
else()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
)
endif()

add_library(g3dlib STATIC ${g3dlib_STAT_SRCS})

target_include_directories(g3dlib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)

target_link_libraries(g3dlib
${ZLIB_LIBRARIES}
)
PUBLIC
zlib
threads)

set_target_properties(g3dlib
PROPERTIES
FOLDER
"dep")
Loading

0 comments on commit c9320ed

Please sign in to comment.