Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gcc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
- uses: actions/checkout@v2
- name: Dependencies
run: |
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: Setup
run: |
mkdir bin
Expand Down
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,17 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.25)

# add this options before PROJECT keyword
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

# Set projectname (must be done AFTER setting configurationtypes)
project(TrinityCore)

# CMake policies (can not be handled elsewhere)
cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0043 NEW) # Ignore COMPILE_DEFINITIONS_<Config> properties
cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted - prevents intepreting if(SOME_STRING_VARIABLE MATCHES "MSVC") as if(SOME_STRING_VARIABLE MATCHES "1")
cmake_policy(SET CMP0067 NEW) # Honor language standard in try_compile() source-file signature
cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
project(TrinityCore
LANGUAGES CXX C)

# Policies introduced after cmake_minimum_required version (policies up to 3.25 are set automatically)
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables
endif()
Expand All @@ -32,6 +27,10 @@ if(POLICY CMP0153)
cmake_policy(SET CMP0153 NEW) # The exec_program() command should not be called
endif()

if(POLICY CMP0155)
cmake_policy(SET CMP0155 NEW) # C and C++ source files can have a .h extension
endif()

# Set RPATH-handing (CMake parameters)
set(CMAKE_SKIP_BUILD_RPATH 0)
set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
Expand Down
1 change: 1 addition & 0 deletions README Part 2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"This is a High-Effort revival of TrinityCore 4.3.4, architected via AI-Human collaboration (Vibe Coding) to modernize legacy systems for C++20 and 64-bit environments."
Binary file added changes.txt
Binary file not shown.
32 changes: 3 additions & 29 deletions cmake/compiler/clang/settings.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
set(CLANG_EXPECTED_VERSION 11.0.0)
set(CLANG_EXPECTED_VERSION 14.0.0)
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
# apple doesnt like to do the sane thing which would be to use the same version numbering as regular clang
# version number pulled from https://en.wikipedia.org/wiki/Xcode#Toolchain_versions for row matching LLVM 11
set(CLANG_EXPECTED_VERSION 12.0.5)
# As of Xcode 14 / AppleClang 14, version numbers match upstream LLVM Clang
set(CLANG_EXPECTED_VERSION 14.0.0)
# enable -fpch-instantiate-templates for AppleClang (by default it is active only for regular clang)
set(CMAKE_C_COMPILE_OPTIONS_INSTANTIATE_TEMPLATES_PCH -fpch-instantiate-templates)
set(CMAKE_CXX_COMPILE_OPTIONS_INSTANTIATE_TEMPLATES_PCH -fpch-instantiate-templates)
Expand All @@ -14,31 +13,6 @@ else()
message(STATUS "Clang: Minimum version required is ${CLANG_EXPECTED_VERSION}, found ${CMAKE_CXX_COMPILER_VERSION} - ok!")
endif()

# This tests for a bug in clang-7 that causes linkage to fail for 64-bit from_chars (in some configurations)
# If the clang requirement is bumped to >= clang-8, you can remove this check, as well as
# the associated ifdef block in src/common/Utilities/StringConvert.h
include(CheckCXXSourceCompiles)

check_cxx_source_compiles("
#include <charconv>
#include <cstdint>

int main()
{
uint64_t n;
char const c[] = \"0\";
std::from_chars(c, c+1, n);
return static_cast<int>(n);
}
" CLANG_HAVE_PROPER_CHARCONV)

if (NOT CLANG_HAVE_PROPER_CHARCONV)
message(STATUS "Clang: Detected from_chars bug for 64-bit integers, workaround enabled")
target_compile_definitions(trinity-compile-option-interface
INTERFACE
TRINITY_NEED_CHARCONV_WORKAROUND)
endif()

if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface
INTERFACE
Expand Down
2 changes: 1 addition & 1 deletion cmake/compiler/gcc/settings.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(GCC_EXPECTED_VERSION 11.1.0)
set(GCC_EXPECTED_VERSION 12.1.0)

if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
message(FATAL_ERROR "GCC: TrinityCore requires version ${GCC_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
Expand Down
7 changes: 4 additions & 3 deletions cmake/compiler/msvc/settings.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(MSVC_EXPECTED_VERSION 19.32)
set(MSVC_EXPECTED_VERSION_STRING "Microsoft Visual Studio 2022 17.2")
set(MSVC_EXPECTED_VERSION 19.36)
set(MSVC_EXPECTED_VERSION_STRING "Microsoft Visual Studio 2022 17.6")

# This file is also used by compilers that pretend to be MSVC but report their own version number - don't version check them
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
Expand All @@ -26,7 +26,8 @@ target_compile_options(trinity-warning-interface
# disable permissive mode to make msvc more eager to reject code that other compilers don't already accept
target_compile_options(trinity-compile-option-interface
INTERFACE
/permissive-)
/permissive-
/utf-8) # set source and execution character set to UTF-8

if(PLATFORM EQUAL 32)
# mark 32 bit executables large address aware so they can use > 2GB address space
Expand Down
8 changes: 6 additions & 2 deletions cmake/macros/ConfigureBaseTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# An interface library to make the target com available to other targets
add_library(trinity-compile-option-interface INTERFACE)

# Use -std=c++11 instead of -std=gnu++11
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD ${TRINITY_CXX_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Set build-directive (used in core to tell which buildtype we used)
target_compile_definitions(trinity-compile-option-interface
Expand Down Expand Up @@ -68,3 +68,7 @@ target_link_libraries(trinity-core-interface
INTERFACE
trinity-default-interface
trinity-warning-interface)

target_compile_features(trinity-core-interface
INTERFACE
"cxx_std_${TRINITY_CXX_STANDARD}")
6 changes: 6 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

set(TRINITY_CXX_STANDARD "20" CACHE STRING "C++ standard version to build with (20 or 23)")
set_property(CACHE TRINITY_CXX_STANDARD PROPERTY STRINGS 20 23)
if(NOT TRINITY_CXX_STANDARD MATCHES "^(20|23)$")
message(FATAL_ERROR "TRINITY_CXX_STANDARD must be 20 or 23, got: ${TRINITY_CXX_STANDARD}")
endif()

option(SERVERS "Build worldserver and authserver" 1)

set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic)
Expand Down
1 change: 1 addition & 0 deletions cmake/showoptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT IS_MULTI_CONFIG)
message("* TrinityCore buildtype : ${CMAKE_BUILD_TYPE}")
endif()
message("* C++ standard : C++${TRINITY_CXX_STANDARD}")
message("")

# output information about installation-directories and locations
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Loading