Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Commit 169b929

Browse files
committed
Merge branch 'release' into feature/mystery
# Conflicts: # win32/vcxproj/topaz_game.vcxproj # win32/vcxproj/topaz_game.vcxproj.filters
2 parents 56f7446 + fd61f02 commit 169b929

File tree

338 files changed

+8141
-9201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+8141
-9201
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Checks: >
1414
-readability-magic-numbers,
1515
-readability-convert-member-functions-to-static,
1616
-readability-implicit-bool-conversion,
17+
-readability-uppercase-literal-suffix,
1718
modernize-*,
1819
-modernize-use-trailing-return-type,
1920
performance-*,

.github/workflows/build.yml

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- 'feature/**'
1414

1515
jobs:
16-
Linux_Build_32bit:
16+
Linux_Build_Clang_64bit:
1717
runs-on: ubuntu-18.04
1818
steps:
1919
- uses: actions/checkout@v1
@@ -22,31 +22,17 @@ jobs:
2222
- name: Install Dependencies
2323
run: |
2424
sudo apt-get update
25-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7
26-
- name: Build C++
25+
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
26+
- name: Configure CMake
2727
run: |
28-
g++ --version
29-
sh autogen.sh "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
30-
./configure
31-
make -j $(nproc)
32-
33-
Linux_Build_32bit_CMake:
34-
runs-on: ubuntu-18.04
35-
steps:
36-
- uses: actions/checkout@v1
37-
with:
38-
fetch-depth: 0
39-
- name: Install Dependencies
40-
run: |
41-
sudo apt-get update
42-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7 cmake
43-
- name: Build C++
44-
run: |
45-
g++ --version
28+
export CC=/usr/bin/clang
29+
export CXX=/usr/bin/clang++
4630
cmake .
31+
- name: Build
32+
run: |
4733
make -j $(nproc)
4834
49-
Linux_Build_64bit:
35+
Linux_Build_GCC_64bit:
5036
runs-on: ubuntu-18.04
5137
steps:
5238
- uses: actions/checkout@v1
@@ -55,57 +41,54 @@ jobs:
5541
- name: Install Dependencies
5642
run: |
5743
sudo apt-get update
58-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7
59-
- name: Build C++
44+
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
45+
- name: Configure CMake
46+
run: |
47+
export CC=/usr/bin/gcc
48+
export CXX=/usr/bin/g++
49+
CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 cmake .
50+
- name: Build
6051
run: |
61-
g++ --version
62-
sh autogen.sh
63-
./configure "CFLAGS=-m64" "CXXFLAGS=-m64" "LDFLAGS=-m64"
6452
make -j $(nproc)
6553
66-
Windows_Build_32bit:
54+
Windows_Build_2019_32bit:
6755
runs-on: windows-2019
6856
env:
6957
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
7058
steps:
7159
- uses: actions/checkout@v1
7260
with:
7361
fetch-depth: 0
74-
- name: Build Solution
62+
- name: Configure CMake
7563
shell: cmd
64+
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
7665
run: |
77-
"%MSBUILD_PATH%\MSBuild.exe" win32/topaz.sln /property:Platform=Win32
78-
79-
Windows_Build_32bit_CMake:
80-
runs-on: windows-2019
81-
env:
82-
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
83-
steps:
84-
- uses: actions/checkout@v1
85-
with:
86-
fetch-depth: 0
87-
- name: Build Solution
66+
cmake -A Win32 . -DMYSQL_INCLUDE_DIR='%CD%/ext/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/lib/libmariadb.lib'
67+
- name: Build
8868
shell: cmd
8969
run: |
90-
cmake . -G "Visual Studio 16 2019"
91-
"%MSBUILD_PATH%\MSBuild.exe" topaz.sln
70+
cmake --build .
9271
93-
Windows_Build_64bit:
72+
Windows_Build_2019_64bit:
9473
runs-on: windows-2019
9574
env:
9675
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
9776
steps:
9877
- uses: actions/checkout@v1
9978
with:
10079
fetch-depth: 0
101-
- name: Build Solution
80+
- name: Configure CMake
81+
shell: cmd
82+
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
83+
run: |
84+
cmake -A x64 . -DMYSQL_INCLUDE_DIR='%CD%/ext/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/lib64/libmariadb64.lib'
85+
- name: Build
10286
shell: cmd
10387
run: |
104-
"%MSBUILD_PATH%\MSBuild.exe" win32/topaz.sln /property:Platform=x64
88+
cmake --build .
10589
10690
Style_Checks:
10791
runs-on: ubuntu-20.04
108-
if: github.event_name == 'pull_request'
10992
steps:
11093
- uses: actions/checkout@v1
11194
with:
@@ -159,12 +142,12 @@ jobs:
159142
- name: Install Dependencies
160143
run: |
161144
sudo apt-get update
162-
sudo apt-get install -y software-properties-common mariadb-server-10.1 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev autoconf pkg-config zlib1g-dev libssl-dev
145+
sudo apt-get install -y software-properties-common cmake mariadb-server libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks python3.7
146+
- name: Configure CMake
147+
run: |
148+
cmake .
163149
- name: Build Binaies
164150
run: |
165-
g++ --version
166-
sh autogen.sh
167-
./configure "CFLAGS=-m64" "CXXFLAGS=-m64" "LDFLAGS=-m64"
168151
make -j $(nproc)
169152
- name: Verify MySQL connection from container
170153
run: |
@@ -181,8 +164,9 @@ jobs:
181164
cp conf/default/* conf/
182165
- name: Run services (2 mins)
183166
env:
184-
MYSQL_HOST: mydb
167+
MYSQL_HOST: mysql
185168
run: |
169+
ls -l
186170
screen -d -m -S topaz_connect ./topaz_connect --log login-server.log
187171
screen -d -m -S topaz_game ./topaz_game --log map-server.log
188172
screen -d -m -S topaz_search ./topaz_search --log search-server.log

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,25 @@ navmeshes/*.nav
164164
tags
165165
log/tpz.leaks
166166

167-
#Lua Developement Tools project files
167+
# Lua Developement Tools project files
168168
.metadata/**
169169
.project
170170
.vs
171171
/win32/.vs/topaz/v15
172172

173-
#VS Code
173+
# VS Code
174174
.vscode
175175

176+
# Visual Studio
177+
**/*.vcxproj*
178+
**/*.sln
179+
176180
# CMake files
177181
CMakeCache.txt
178182
Makefile
179183
**/CMakeFiles
180184
cmake_install.cmake
185+
/cmake-**/**
181186

182187
# ignore servers
183188
*-server
@@ -192,3 +197,6 @@ cmake_install.cmake
192197
/conf/search_server.conf
193198
/conf/server_message.conf
194199
/conf/server_message_fr.conf
200+
201+
# Tracy download
202+
tracy/

CMakeLists.txt

Lines changed: 58 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,61 @@
1-
cmake_minimum_required(VERSION 3.9)
2-
project(topaz)
3-
4-
set(CMAKE_VERBOSE_MAKEFILE ON)
5-
6-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
7-
include(compiler)
8-
9-
if(UNIX)
10-
find_package(PkgConfig REQUIRED)
11-
12-
include(FindThreads)
13-
14-
pkg_search_module(MYSQLCLIENT mariadb)
15-
if(NOT MYSQLCLIENT_FOUND)
16-
pkg_search_module(MYSQLCLIENT REQUIRED mysqlclient)
17-
endif()
18-
pkg_search_module(ZMQ REQUIRED libzmq)
19-
pkg_search_module(LUAJIT REQUIRED luajit)
20-
else()
21-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
22-
set(platform_suffix "64")
23-
set(spacer "_")
24-
set(lib_dir lib64)
25-
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
26-
set(platform_suffix "")
27-
set(spacer "")
28-
set(lib_dir lib)
29-
endif()
30-
31-
link_directories(${lib_dir})
32-
33-
if(CMAKE_CONFIGURATION_TYPES STREQUAL Debug)
34-
set(lib_debug "-d")
35-
else()
36-
set(lib_debug "")
37-
endif()
38-
endif()
39-
1+
cmake_minimum_required(VERSION 3.10)
2+
project(topaz CXX)
3+
4+
set_property(GLOBAL PROPERTY CXX_STANDARD 17)
5+
set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED ON)
6+
set_property(GLOBAL PROPERTY CXX_EXTENSIONS ON)
7+
set_property(GLOBAL PROPERTY LINKER_LANGUAGE CXX)
8+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
9+
10+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
11+
include(Platform)
12+
include(StandardProjectSettings)
13+
include(CompilerWarnings)
14+
include(Sanitizers)
15+
include(ClangTidy)
16+
include(Tracy)
17+
18+
message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
19+
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
20+
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
21+
message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
22+
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
23+
message(STATUS "CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
24+
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
25+
message(STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
26+
message(STATUS "CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
27+
28+
# set(CMAKE_VERBOSE_MAKEFILE ON)
29+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
30+
31+
set(LOCAL_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/ext/include)
32+
set(LOCAL_LIB_PATH ${PROJECT_SOURCE_DIR}/ext/${libpath})
33+
message(STATUS "LOCAL_INCLUDE_PATH: ${LOCAL_INCLUDE_PATH}")
34+
message(STATUS "LOCAL_LIB_PATH: ${LOCAL_LIB_PATH}")
35+
36+
# Find Threads (pthread)
37+
set(THREADS_PREFER_PTHREAD_FLAG ON)
38+
find_package(Threads REQUIRED)
39+
link_libraries(${CMAKE_THREAD_LIBS_INIT})
40+
41+
# Find MySQL
42+
find_package(MySQL REQUIRED)
43+
44+
# Find ZMQ
45+
find_package(ZeroMQ REQUIRED)
46+
47+
# Find LuaJIT
48+
find_package(LuaJIT)
49+
50+
# Link this 'library' to set the c++ standard / compile-time options requested
51+
add_library(project_options INTERFACE)
52+
target_compile_features(project_options INTERFACE cxx_std_17)
53+
54+
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
55+
add_library(project_warnings INTERFACE)
56+
set_project_warnings(project_warnings)
57+
58+
# Ouput executables into repo root
4059
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
4160
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR})
4261
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR})

0 commit comments

Comments
 (0)