diff --git a/.gitattributes b/.gitattributes index 9fa544d91af..e71d3421e43 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,9 @@ *.vcproj eol=crlf *.vcxproj* eol=crlf +src/shared/revision_nr.h eol=lf +src/shared/revision_sql.h eol=lf + # Whitespace rules # strict (no trailing, no tabs) *.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol diff --git a/.gitignore b/.gitignore index 3f09f30388e..23c653b0165 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ tags TAGS !.gitignore !.gitattributes +!.travis.yml # # Build generated files @@ -39,6 +40,7 @@ autom4te.cache *~ *.bak *.orig +*.rej *.patch callgrind.out.* @@ -52,6 +54,11 @@ patches-* # VS binaries output # bin/* +*win32_Debug* +*win32_Release* +*x64_Debug* +*x64_Release* +win/*/*.log # # VS temporary files @@ -64,6 +71,10 @@ bin/* *.vsp ipch *.user +*.obj +*.pdb +*.tlog + # # CMake temporary files @@ -72,6 +83,11 @@ CMakeFiles CMakeCache.txt cmake_install.cmake +# +# System-internal temporary files +# +config.h + # # OS specific # diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..e5b1f726b8e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/bindings/ScriptDev2"] + path = src/bindings/ScriptDev2 + url = git://github.com/mangosR2/scriptdev2.git diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..993383ee529 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: cpp + +branches: + only: + - mangosr2-wotlk_ai + +compiler: + - gcc + - clang + +script: + - test -d _build || mkdir _build + - test -d _install || mkdir _install + - cd _build + - cmake -DPCH=1 -DCMAKE_INSTALL_PREFIX=../_install .. + - make -j4 diff --git a/CMakeLists.txt b/CMakeLists.txt index a30019d849b..b6c080e3eb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,6 @@ # project(MaNGOS) -set(MANGOS_VERSION 0.17.0) # CMake policies cmake_minimum_required(VERSION 2.8) @@ -27,6 +26,78 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) +# define all options here +option(DEBUG "Debug mode" OFF) +option(TBB_USE_EXTERNAL "Use external TBB" OFF) +#option(USE_STD_MALLOC "Use standard malloc instead of TBB" OFF) +#option(USE_TBB_MALLOC "Use included TBB malloc" OFF) +option(ACE_USE_EXTERNAL "Use external ACE" ON) + +if(WIN32) + if(PLATFORM MATCHES X86) # 32-bit + option(USE_FASTMM_MALLOC "Use included FastMM malloc (default for win*)" 1) + option(USE_STD_MALLOC "Use standard malloc instead of TBB" 0) + else() # 64-bit + option(USE_STD_MALLOC "Use standard malloc instead of TBB" 0) + option(USE_FASTMM_MALLOC "Use included FastMM malloc (default for win*)" 1) + endif() +else() +#Unix and other platforms + option(USE_STD_MALLOC "Use standard malloc instead of TBB" 1) +endif() + +option(POSTGRESQL "Use PostgreSQL" OFF) + +if(PCHSupport_FOUND AND WIN32) # TODO: why only enable it on windows by default? + option(PCH "Use precompiled headers" ON) +else() + option(PCH "Use precompiled headers" OFF) +endif() +# TODO: options that should be checked/created: +#option(CLI "With CLI" ON) +#option(RA "With Remote Access" OFF) +#option(SQL "Copy SQL files" OFF) +#option(TOOLS "Build tools" OFF) + +find_package(PCHSupport) + +# Add options for compile of mangos +if(PCHSupport_FOUND) + if(WIN32) + option(PCH "Use precompiled headers" 1) + else() + option(PCH "Use precompiled headers" 0) + endif() +endif() + +# FIXME: options that should be checked +# option(SQL "Copy SQL files" 0) +# option(TOOLS "Build tools" 0) + +# Output description of this script +message("") +message( + "This script builds the MangosR2 server. + Options that can be used in order to configure the process: + CMAKE_INSTALL_PREFIX Path where the server should be installed to + PCH Use precompiled headers + DEBUG Debug mode + INCLUDE_BINDINGS_DIR Include a script library in src/bindings/ with the + defined name. the name must corespond to the name of + the folder and the folder must contain a valid + CMakeLists.txt + TBB_USE_EXTERNAL Use external TBB + USE_STD_MALLOC Use standard malloc (default for *NIX) + USE_TBB_MALLOC Use TBB malloc (not recommended) + USE_FASTMM_MALLOC Use included FastMM malloc (default for win*) + ACE_USE_EXTERNAL Use external ACE (default. usage included ACE not recommended, possible only for win*) + + To set an option simply type -D