Commit Graph

102 Commits

Author SHA1 Message Date
Shauren
101b0e0741 Build: Enable more msvc standard conformance options
(cherry picked from commit c5425196fd)
2025-08-30 22:55:25 +02:00
Shauren
da4bcad2d7 Build: Remove -fpch-instantiate-templates detection, it is enabled by default since CMake 3.19
(cherry picked from commit 55a19f15d0)
2025-08-30 22:55:25 +02:00
Ovahlord
dce2b90702 Build: enable MSVC warning C5038 - member initialization order to get closer to the warning behavior of the other compilers
(cherry picked from commit e36a66d632)
(cherry picked from commit 2b1ad96be1)
2025-08-30 22:55:25 +02:00
Shauren
92ac60c665 Build: Disable -Wmissing-field-initializers for clang, it now mirrors unwanted gcc behavior since version 18
(cherry picked from commit 93c8993314)
2025-08-30 22:55:25 +02:00
Shauren
9350a0f561 Core/Misc: CompilerDefs/GitRevision improvements
* Removed INTEL as a separate platform (it does not belong there)
* Removed BORLAND from known compilers list (it was never supported)
* Simplified TRINITY_PLATFORM_WINDOWS detection (_WIN32 is always defined)
* Rename revision_data.h macros that begin with a underscore
* Added processor architecture to --version string
* Added Linux distribution name to .server debug
* Fixed some revision_data.h macros missing/wrong values when regenerated during compilation
* Removed manual adding of _WIN64 macro from cmake (it is predefined internally by compiler)

(cherry picked from commit e8740fb2e1)
2025-08-30 22:55:25 +02:00
Shauren
8719b30d57 Build: Disable maybe-uninitialized warning for GCC that incorrectly triggers with std::optional
(cherry picked from commit d93002f9a9)
2025-04-13 19:05:27 +02:00
Shauren
8cbb263c14 Build: CMake cleanup
* Migrate all add_definitions to target_compile_definitions
* Remove -D from preprocessor definitions added by target_compile_definitions (unneccessary, cmake strips it anyway)
* Fixed NO_BUFFERPOOL not being set on g3d if jemalloc is used
* Moved library/compiler specific compile flag settings spread all over various CMakeLists to their related library/compiler file
* Remove ancient manual link flag settings for worldserver

(cherry picked from commit 77fe2745fe)
2025-04-13 19:05:21 +02:00
Shauren
5269de5919 Build: Decouple compiler specific settings from os settings
(cherry picked from commit 12d1f4448c)
2025-04-13 18:23:15 +02:00
Shauren
3a2bb2fcfd Build: Normalize executable locations in build directory for all platforms
(cherry picked from commit a7c42f1ed5)
2025-04-13 18:22:53 +02:00
Shauren
857d0b2c27 Build: Unify setting _BUILD_DIRECTIVE preprocessor macro for all compilers
(cherry picked from commit 078bc6fe3f)
2025-04-13 18:17:40 +02:00
Shauren
b7783c9cfb Build: Remove unneccessary /MP compile option when using ninja
(cherry picked from commit 1083e89da3)
2025-04-13 18:17:04 +02:00
Shauren
6817ad93d7 Build: Update required GCC version to 11.1
(cherry picked from commit 16853af7c8)
2024-04-10 16:16:38 +02:00
Shauren
e48cedb3ed Core/Misc: Fixed windows nopch build
(cherry picked from commit 261a237cfa)
2024-03-13 22:12:16 +01:00
Shauren
73d2e9d6d6 Build: Improve ARM target detection in cmake (needed by MSVC)
(cherry picked from commit 7e51d17a0a)
2024-02-26 12:29:16 +01:00
Shauren
26f7dfb197 Build: Fixed msvc version check
(cherry picked from commit eb847ff537)
2024-02-26 12:29:16 +01:00
Shauren
6a41b0dc06 Build/GCC: Disable useless warning
(cherry picked from commit 0aa644287c)
2024-02-26 12:26:37 +01:00
Shauren
0929d3dfdd Build: Increase required msvc version slightly
(cherry picked from commit 1ed8bfa080)
2024-02-26 12:26:37 +01:00
Ovahlord
e6069c14ab Build: moved MSVC warning C5054 from warning level 4 to 3
(cherry picked from commit d535977c6d)
2024-02-26 12:26:36 +01:00
Shauren
4d220221bf Build: Fixed copypaste mistake in appleclang version check
(cherry picked from commit 8d353f20fd)
2024-02-26 12:23:57 +01:00
Shauren
367c5db9f4 Core/Misc: Fix build with libc++
Closes #28909

(cherry picked from commit 083b8d6c84)
2024-02-26 12:23:57 +01:00
Shauren
c703497655 Build: Partial support for clang-cl
(cherry picked from commit 0b846b2107)
2024-02-26 12:16:13 +01:00
Shauren
0ce6a573a6 Build: Enable some msvc warnings that are enabled for other compilers
(cherry picked from commit 73b4b1733a)
2024-02-26 12:16:13 +01:00
Shauren
ca03ecf3e6 Build: Support ASAN on msvc
(cherry picked from commit 0a0b420d86)
2023-08-23 14:23:56 +02:00
Shauren
97c977d0fb Build: Update required compilers to current debian stable and VS 2022
GCC: 10
Clang: 11
MSVC: 2022
(cherry picked from commit 0a1b40241a)
2023-08-12 14:24:30 +02:00
Giacomo Pozzoni
a4e93d779c Improve multithreading of mmaps_generator (#25625)
* Build/Misc: Add a few *San CMake flags

Add the following flags for the related tools:
- MSAN for Memory Sanitizer
- UBSAN for Undefined Behavior Sanitizer
- TSAN for Thread Sanitizer

* Remove unused parameter

* Fix UBSan reported issue

* Disable G3D buffer pools when using Thread Sanitizer as it has its custom locking mechanisms

* Code cleanup

* Move threads from maps to tiles

* Move tile building logic to TileBuilder class

* Fix memory leak in TileBuilder

* Fix build

* Store TileBuilder as raw pointer for now, it will be changed later on to use modern C++ constructs

* Fix crash on shutdown

* Revert pvs-studio change

* Fix generating 1 single tile not closing the program
2020-12-06 17:52:13 +01:00
Treeston
cd30e0b86c Common/Utilities: Centralize string -> T conversion in StringConvert.h (PR #25335) 2020-08-26 23:31:45 +02:00
Treeston
27b1930d97 Build: Add Clang version guard to CMake (PR #25324) 2020-08-24 17:44:38 +02:00
Giacomo Pozzoni
41d70a5905 Build/GCC: Raise required version to 8.3.0 (#25297)
Even when building with Clang, make sure to have libstdc++ >= 8
2020-08-21 13:51:29 +02:00
Shauren
c8fed48b16 Build: Enable /permissive- flag on msvc 2020-08-04 15:50:31 +02:00
Peter Keresztes Schmidt
e6e5775be8 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2020-07-18 20:43:16 +02:00
Shauren
042b1abfd7 Fix warnings related to Vector3::operator= and remove -Wno-deprecated-copy suppression 2020-07-13 18:35:13 +02:00
ipriver
a46d047f94 fixed indentation for cmake files 2020-06-24 14:42:02 +02:00
Giacomo Pozzoni
8c09b6e58b Cherry-pick some cmake commits (#24720)
* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4)

# Conflicts:
#	src/common/Utilities/Util.h
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/game/Entities/Object/Position.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Guilds/GuildFinderMgr.h
#	src/server/game/Movement/Spline/MoveSplineFlag.h
#	src/server/shared/Dynamic/LinkedList.h

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c56)

# Conflicts:
#	src/common/Utilities/Util.cpp
#	src/server/database/Database/MySQLConnection.cpp
#	src/server/game/Battlefield/Zones/BattlefieldTB.cpp
#	src/server/game/DataStores/M2Stores.cpp
#	src/server/game/DungeonFinding/LFGMgr.cpp
#	src/server/game/DungeonFinding/LFGPlayerData.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Object/Updates/UpdateFields.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/RestMgr.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Server/Packets/GuildPackets.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellInfo.cpp
#	src/server/game/Spells/SpellMgr.cpp
#	src/server/scripts/Argus/AntorusTheBurningThrone/boss_garothi_worldbreaker.cpp
#	src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
#	src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
#	src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
#	src/server/scripts/Northrend/zone_sholazar_basin.cpp
#	src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
#	src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
#	src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
#	src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
#	src/tools/vmap4_extractor/gameobject_extract.cpp
#	src/tools/vmap4_extractor/model.cpp
#	src/tools/vmap4_extractor/vec3d.h

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b764)

# Conflicts:
#	dep/boost/CMakeLists.txt

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-05-31 14:17:26 +02:00
Giacomo Pozzoni
1df52da0b0 Require Visual Studio 2019 16.4 or greater (#24214)
* CI/AppVeyor: Add appveyor.yml file

* Build: Require Visual Studio 2019 16.4 or greater

* CI/AppVeyor: Upgrade to VS2019 image

* Update cmake error message

* CI/AppVeyor: Fix appveyor VS 2019 configuration
2020-04-03 21:14:09 +02:00
daMaex
ce449f6b53 Core: build on aarch64 with gcc (#24216)
* build on aarch64 with gcc

* Core/aarch64: readability on preprocessor macro

* Core/aarch64: TC C++ codestyle adjustment
2020-03-01 20:16:57 +01:00
Giacomo Pozzoni
726d5e91b5 Build: Enable and require c++17 (#23868)
* Build: Enable and require c++17

* Build: Raise Visual Studio version from 2017 15.2 to 2017 15.9

* Build: Raise GCC version from 6.3.0 to 7.1.0

* Reduce branch differences

* Fix build after latest merge

* Cleanup after latest merge
2020-02-08 18:14:09 +01:00
jackpoz
580f40769c Build/Misc: Add ASan CMake flag
Allow to enable/disable Address Sanitizer in Clang and GCC from CMake flag "ASAN" of type Boolean. It can be enabled passing -DASAN=TRUE to CMake.
2019-10-19 20:12:48 +02:00
Shauren
12852ddb30 Build/Misc: Removed -DDEBUG from clang compile options
(cherry picked from commit b0609757d3)
2019-01-18 19:58:02 +01:00
Naios
9d0400211d Build: Export a default interface which doesn't hide symbols in unix automatically
(cherry picked from commit db5d5a03be)
2017-12-21 23:31:11 +01:00
Naios
b9b667f925 Build: Require Visual Studio 2017 or greater
* See the deprecation notice at
  https://community.trinitycore.org/topic/13294-gcc-49-visual-studio-2015-end-of-life/
2017-12-17 20:22:34 +01:00
Naios
697b4dbef2 Build: Experimentally disable the /Zm workaround for MSVC 2017-12-17 20:22:34 +01:00
Naios
e60c1f84a7 Build: Use interface targets for inheriting flags and definitions
* Remove the usage of global flags and definitions
  set through the CMAKE_CXX_FLAGS variable.
* Use cmake target compile features for setting the
  CXX standard automatically.
* Make C++14 globally available in the project
* Closes #21033
2017-12-17 20:22:33 +01:00
Naios
5a9ccae3e1 Build: Set the minimum required compiler version to GCC 6.3
* This is the current GCC version of debian 9
2017-12-17 20:22:33 +01:00
Aokromes
445c5a00e8 Buildsystem: Enforce Visual Studio 2015 Update 1 in CMake
Even if it's for few days, it looks it's absolute minimum needed to compile 3.3.5a for now
2017-06-27 03:50:18 +02:00
jackpoz
c852022388 Buildsystem/MSVC: Drop support to VS2013
Upgrade to VS2015 following the steps explained in the wiki
2016-08-18 14:30:48 +02:00
Vincent-Michael
0ab6ecbdc6 Build/GCC: Enforce version 4.7.2
(cherry picked from commit ede8f0ca0a)
2016-05-14 18:40:22 +02:00
Naios
8660f90bdf Core/Scripts: Split script subdirectories into independent modules
* Makes it possible to define the linkage for every module
* Move the ScriptPCH into the root directory
* Changes the SCRIPTS cmake variable to a string type:
  -> -DSCRIPTS=0 is -DSCRIPTS="minimal-static" now
     (builds commands and spells statically)
  -> -DSCRIPTS=1 is -DSCRIPTS="static" now
     (builds all modules statically)
  -> -DSCRIPTS="dynamic"
     (builds all modules dynamically)
  -> Also the default value which is provided by the SCRIPTS
     variable is overwriteable through the SCRIPTS_COMMANDS,
     SCRIPTS_SPELLS... variable.

(cherry picked from commit 848b8a4136)
2016-04-11 21:41:58 +02:00
Shauren
43fb6b2209 Buildsystem: Improved logic for _BUILD_DIRECTIVE in msvc builds
(cherry picked from commit 509a27fd51)
2016-04-09 12:39:03 +02:00
Shauren
702cfefddb Buildsystem: Initial changes to support building with vs clang toolset
(cherry picked from commit 4a3a178d7f)
2016-04-09 12:38:20 +02:00
Naios
77aa9ae01d Core/Build: Enable /bigobj for most MSVC builds.
* exluding 32 bit when dyynamic linking is disabled.

(cherry picked from commit 183f970055)
2016-03-24 02:45:14 +01:00