Skip to content
Open
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
17 changes: 16 additions & 1 deletion .github/apps/ci/ci-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ cd _build
# PCH is OFF on purpose. A precompiled header supplies declarations the source never
# named, so a green PCH build says nothing about whether a file includes what it uses --
# and that is exactly the class of defect this CI exists to catch.
time cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_TOOLS:BOOL=1 -DBUILD_MANGOSD:BOOL=1 -DBUILD_REALMD:BOOL=1 -DSOAP:BOOL=1 -DSCRIPT_LIB_ELUNA:BOOL=1 -DSCRIPT_LIB_SD3:BOOL=1 -DPLAYERBOTS:BOOL=1 -DPCH:BOOL=0
#
# BUILD_CONFEDITOR* are Windows-only; left ON so configure options match StatusInfo.
# On Linux the confeditor subdirectory returns without creating targets.
time cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DBUILD_TOOLS:BOOL=1 \
-DBUILD_MANGOSD:BOOL=1 \
-DBUILD_REALMD:BOOL=1 \
-DBUILD_AH_SERVICE:BOOL=1 \
-DBUILD_CONFEDITOR:BOOL=1 \
-DBUILD_CONFEDITOR_WEB:BOOL=1 \
-DSOAP:BOOL=1 \
-DSCRIPT_LIB_ELUNA:BOOL=1 \
-DSCRIPT_LIB_SD3:BOOL=1 \
-DPLAYERBOTS:BOOL=1 \
-DPCH:BOOL=0

time make -j $(nproc)
time make install
6 changes: 4 additions & 2 deletions .github/workflows/core_linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
key: linux-${{ matrix.name }}
max-size: 500M

# WITH_NET_TESTS off (slow sockets). CONFEDITOR* ON for option parity;
# the subdirectory is a no-op on Linux.
- name: Configure
run: >
cmake -S . -B "$BUILD_DIR" -G Ninja
Expand All @@ -66,9 +68,9 @@ jobs:
-DBUILD_MANGOSD=1
-DBUILD_REALMD=1
-DBUILD_AH_SERVICE=1
-DBUILD_CONFEDITOR=1
-DBUILD_CONFEDITOR_WEB=1
-DWITH_TESTS=1
# Never the socket tests: they bind real listeners and dominate the
# suite's wall-clock. A human asks for them, CI does not.
-DWITH_NET_TESTS=0
-DSOAP=1
-DSCRIPT_LIB_ELUNA=1
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/core_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ jobs:
key: windows-msvc
max-size: 500M

# WITH_NET_TESTS stays off: socket tests bind real listeners and dominate wall-clock.
# BUILD_CONFEDITOR_WEB fetches the WebView2 NuGet SDK at configure (needs network).
- name: Configure
shell: bash
run: >
Expand All @@ -122,9 +124,10 @@ jobs:
-DBUILD_MANGOSD=1
-DBUILD_REALMD=1
-DBUILD_AH_SERVICE=1
-DBUILD_CONFEDITOR=1
-DBUILD_CONFEDITOR_WEB=1
-DWEBVIEW2_FETCH_SDK=1
-DWITH_TESTS=1
# Never the socket tests: they bind real listeners and dominate the
# suite's wall-clock. A human asks for them, CI does not.
-DWITH_NET_TESTS=0
-DSOAP=1
-DSCRIPT_LIB_ELUNA=1
Expand All @@ -151,6 +154,24 @@ jobs:
echo "$out" | grep -q "intent codec selftest OK" || { echo "MISSING: intent codec selftest OK"; exit 1; }
echo "$out" | grep -q "ipc selftest OK" || { echo "MISSING: ipc selftest OK"; exit 1; }

# Both conf editors are Windows-only; the web one needs WebView2 SDK at
# configure (fetched) and the Runtime only at run time (present on runners).
- name: Verify conf editors built
shell: bash
run: |
win32="$(find "$BUILD_DIR" -type f -name mangos-conf-editor.exe | head -n1)"
web="$(find "$BUILD_DIR" -type f -name mangos-conf-editor-web.exe | head -n1)"
if [ -z "$win32" ]; then echo "mangos-conf-editor.exe not found"; exit 1; fi
if [ -z "$web" ]; then echo "mangos-conf-editor-web.exe not found"; exit 1; fi
ui_dir="$(dirname "$web")/confeditor-ui"
if [ ! -f "$ui_dir/index.html" ]; then
echo "confeditor-ui/index.html missing next to web editor"
exit 1
fi
echo "Win32 conf editor: $win32"
echo "Web conf editor: $web"
echo "HTML UI: $ui_dir"

- name: Verify the working tree is clean
shell: bash
run: |
Expand Down
53 changes: 29 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,43 +62,48 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

#==================================================================================
# Define available cmake options below
option(BUILD_MANGOSD "Build the main server" ON)
option(BUILD_REALMD "Build the login server" ON)
option(BUILD_TOOLS "Build the client-data extractor" ON)
option(SCRIPT_LIB_ELUNA "Compile with support for Eluna scripts" ON)
option(SCRIPT_LIB_SD3 "Compile with support for ScriptDev3 scripts" ON)
option(PLAYERBOTS "Enable Player Bots" OFF)
option(SOAP "Enable remote access via SOAP" OFF)
option(PCH "Enable precompiled headers" ON)
option(WITH_IO_URING "Use the io_uring network backend (Linux, needs liburing)" OFF)
option(DEBUG "Enable debug build (only on non IDEs)" OFF)
option(WITHOUT_GIT "Disable Git revision detection" OFF)
option(BUILD_AH_SERVICE "Build the out-of-process auction-house service" ON)
option(WITH_TESTS "Build the unit tests" OFF)
option(WITH_NET_TESTS "Build the socket tests (slow; never in CI)" OFF)
# Keep this list, the help message below, and cmake/StatusInfo.cmake in sync.
option(BUILD_MANGOSD "Build the main server" ON)
option(BUILD_REALMD "Build the login server" ON)
option(BUILD_TOOLS "Build the client-data extractor" ON)
option(BUILD_CONFEDITOR "Build the Win32 mangosd.conf editor (Windows)" ON)
option(BUILD_CONFEDITOR_WEB "Build the HTML/WebView2 conf editor (Windows)" ON)
option(BUILD_AH_SERVICE "Build the out-of-process auction-house service" ON)
option(SCRIPT_LIB_ELUNA "Compile with support for Eluna scripts" ON)
option(SCRIPT_LIB_SD3 "Compile with support for ScriptDev3 scripts" ON)
option(PLAYERBOTS "Enable Player Bots" OFF)
option(SOAP "Enable remote access via SOAP" OFF)
option(PCH "Enable precompiled headers" ON)
option(WITH_IO_URING "Use the io_uring network backend (Linux, needs liburing)" OFF)
option(WITH_TESTS "Build the unit tests" OFF)
option(WITH_NET_TESTS "Build the socket tests (slow; never in CI)" OFF)
option(DEBUG "Enable debug build (only on non IDEs)" OFF)
option(WITHOUT_GIT "Disable Git revision detection" OFF)
#==================================================================================
message("")
message(
"This script builds the MaNGOS server.
Options that can be used in order to configure the process:
Options that can be used in order to configure the process
(same set is summarised at the end of configure by cmake/StatusInfo.cmake):

General:
CMAKE_INSTALL_PREFIX Path where the server should be installed to
BUILD_MANGOSD Build the main server
BUILD_REALMD Build the login server
BUILD_TOOLS Build the client-data extractor
BUILD_CONFEDITOR Win32 mangosd.conf dialog editor (Windows only)
BUILD_CONFEDITOR_WEB HTML/WebView2 conf editor (Windows; needs WebView2 SDK)
BUILD_AH_SERVICE Out-of-process auction-house service
SCRIPT_LIB_ELUNA Compile with support for Eluna scripts
SCRIPT_LIB_SD3 Compile with support for ScriptDev3 scripts
PLAYERBOTS Enable Player Bots
SOAP Enable remote access via SOAP
PCH Enable use of precompiled headers
WITH_TESTS Build the unit tests (target: mangos_tests)
WITH_NET_TESTS Build the socket tests as well. Disjoint from WITH_TESTS,
off by default, and deliberately not run in CI: they bind
real sockets and dominate the suite's wall-clock time.
WITH_IO_URING io_uring network backend (Linux; needs liburing)
WITH_TESTS Unit tests (target: mangos_tests)
WITH_NET_TESTS Socket tests (slow; never in CI)
DEBUG Debug build, only for systems without IDE (Linux, *BSD)
WITHOUT_GIT Disable Git revision detection
Scripting engines:
SCRIPT_LIB_ELUNA Compile with support for Eluna scripts
SCRIPT_LIB_SD3 Compile with support for ScriptDev3 scripts
Modules:
PLAYERBOTS Enable Player Bots

To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
Also, you can specify the generator with -G. See 'cmake --help' for more details
Expand Down
151 changes: 126 additions & 25 deletions cmake/StatusInfo.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Mirrors the option() block and help text in the root CMakeLists.txt.
# Keep these in the same order when adding/removing options.

message("===================================================")
message("Mangos revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
message("Build type : ${CMAKE_BUILD_TYPE}")
Expand All @@ -10,9 +13,7 @@ message("+-- operating system : ${CMAKE_HOST_SYSTEM}")
message("+-- cmake version : ${CMAKE_VERSION}")
message("")

# Which network backend the configure step actually resolved. Printed because
# WITH_IO_URING can be asked for and silently not granted (liburing missing), and
# the difference is invisible at runtime until something misbehaves under load.
# Resolved network backend (WITH_IO_URING may be ON but not granted without liburing).
if(WIN32)
message("Network backend : IOCP")
elseif(MANGOS_USE_IO_URING)
Expand All @@ -24,56 +25,156 @@ else()
endif()
message("")

message("Options (root CMakeLists.txt)")
message("---------------------------------------------------")

# --- same order as option() in root CMakeLists.txt ---

# BUILD_MANGOSD (default ON)
if(BUILD_MANGOSD)
message("Build main server : Yes (default)")
if(SCRIPT_LIB_ELUNA)
message("+-- with Eluna script engine")
message("BUILD_MANGOSD : Yes (default)")
else()
message("BUILD_MANGOSD : No")
endif()

# BUILD_REALMD (default ON)
if(BUILD_REALMD)
message("BUILD_REALMD : Yes (default)")
else()
message("BUILD_REALMD : No")
endif()

# BUILD_TOOLS (default ON)
if(BUILD_TOOLS)
message("BUILD_TOOLS : Yes (default)")
else()
message("BUILD_TOOLS : No")
endif()

# BUILD_CONFEDITOR (default ON, Windows only)
if(BUILD_CONFEDITOR)
if(WIN32)
message("BUILD_CONFEDITOR : Yes (Win32, default)")
else()
message("BUILD_CONFEDITOR : Yes (skipped — Windows only)")
endif()
else()
message("BUILD_CONFEDITOR : No")
endif()

# BUILD_CONFEDITOR_WEB (default ON, Windows + WebView2 SDK)
if(BUILD_CONFEDITOR_WEB)
if(WIN32)
if(TARGET mangos-conf-editor-web)
message("BUILD_CONFEDITOR_WEB : Yes (WebView2, default)")
else()
message("BUILD_CONFEDITOR_WEB : Yes (skipped — WebView2 SDK missing)")
endif()
else()
message("BUILD_CONFEDITOR_WEB : Yes (skipped — Windows only)")
endif()
else()
message("BUILD_CONFEDITOR_WEB : No")
endif()

# BUILD_AH_SERVICE (default ON)
if(BUILD_AH_SERVICE)
message("BUILD_AH_SERVICE : Yes (default)")
else()
message("BUILD_AH_SERVICE : No")
endif()

# SCRIPT_LIB_ELUNA (default ON)
if(SCRIPT_LIB_ELUNA)
if(BUILD_MANGOSD)
message("SCRIPT_LIB_ELUNA : Yes (default)")
message(" +-- revision : ${dep_eluna_rev_hash} ${dep_eluna_rev_date} (${dep_eluna_rev_branch} branch)")
else()
message("SCRIPT_LIB_ELUNA : Yes (default, unused without mangosd)")
endif()
if(SCRIPT_LIB_SD3)
message("+-- with SD3 script engine")
else()
message("SCRIPT_LIB_ELUNA : No")
endif()

# SCRIPT_LIB_SD3 (default ON)
if(SCRIPT_LIB_SD3)
if(BUILD_MANGOSD)
message("SCRIPT_LIB_SD3 : Yes (default)")
message(" +-- revision : ${dep_sd3_rev_hash} ${dep_sd3_rev_date} (${dep_sd3_rev_branch} branch)")
endif()
if(PLAYERBOTS)
message("+-- with PlayerBots")
else()
message("SCRIPT_LIB_SD3 : Yes (default, unused without mangosd)")
endif()
else()
message("Build main server : No")
message("SCRIPT_LIB_SD3 : No")
endif()

if(BUILD_REALMD)
message("Build login server : Yes (default)")
# PLAYERBOTS (default OFF)
if(PLAYERBOTS)
if(BUILD_MANGOSD)
message("PLAYERBOTS : Yes")
else()
message("PLAYERBOTS : Yes (unused without mangosd)")
endif()
else()
message("Build login server : No")
message("PLAYERBOTS : No (default)")
endif()

# SOAP (default OFF)
if(SOAP)
message("Support for SOAP : Yes")
message("SOAP : Yes")
else()
message("Support for SOAP : No (default)")
message("SOAP : No (default)")
endif()

if(BUILD_TOOLS)
message("Build tools : Yes (default)")
# PCH (default ON)
if(PCH)
message("PCH : Yes (default)")
else()
message("PCH : No")
endif()

# WITH_IO_URING (default OFF)
if(WITH_IO_URING)
if(MANGOS_USE_IO_URING)
message("WITH_IO_URING : Yes (granted)")
else()
message("WITH_IO_URING : Yes (not granted — need Linux + liburing)")
endif()
else()
message("WITH_IO_URING : No (default)")
endif()

# WITH_TESTS (default OFF)
if(WITH_TESTS)
message("WITH_TESTS : Yes (target: mangos_tests)")
else()
message("WITH_TESTS : No (default)")
endif()

# WITH_NET_TESTS (default OFF)
if(WITH_NET_TESTS)
message("WITH_NET_TESTS : Yes (socket tests; slow)")
else()
message("Build tools : No")
message("WITH_NET_TESTS : No (default)")
endif()

if(WITH_TESTS OR WITH_NET_TESTS)
message("Build tests : Yes (target: mangos_tests)")
# DEBUG (default OFF)
if(DEBUG)
message("DEBUG : Yes")
else()
message("Build tests : No (default)")
message("DEBUG : No (default)")
endif()

# WITHOUT_GIT (default OFF)
if(WITHOUT_GIT)
message("Use GIT revision hash : No")
message("WITHOUT_GIT : Yes")
message("")
message(" *** WITHOUT_GIT - WARNING!")
message(" *** Without Git installed, proper support may not be given.")
message(" *** Some additional information that may be required, is only")
message(" *** given when Git is enabled. Please install Git for support.")
else()
message("Use GIT revision hash : Yes (default)")
message("WITHOUT_GIT : No (default) — Git revision hash enabled")
endif()

message("")
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ add_subdirectory(tools/extractor)
# A clean parse is not correct geometry; this is what says whether it is.
add_subdirectory(tools/height-check)

# Windows-only mangosd.conf editors (Win32 and/or HTML+WebView2).
if(BUILD_CONFEDITOR OR BUILD_CONFEDITOR_WEB)
add_subdirectory(tools/confeditor)
endif()

if (BUILD_MANGOSD OR BUILD_REALMD)
if(WIN32)
get_filename_component(MYSQL_LIB_DIR ${MySQL_LIBRARIES} DIRECTORY)
Expand Down
1 change: 1 addition & 0 deletions src/mangosd/Master.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#endif

#ifdef _WIN32
#include <windows.h>
#include "ServiceWin32.h"
extern int m_ServiceStatus;
#else
Expand Down
Loading
Loading