Skip to content

Commit

Permalink
Add SQLite support for Windows (#576)
Browse files Browse the repository at this point in the history
* Find SQLite library on Windows

* Add SQLite option for cmake GUI

* Add sqlite documentation to mangosd.conf
  • Loading branch information
Foereaper authored Nov 28, 2024
1 parent 637a432 commit aa068d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@ endif()

# Win32 delivered packages
if(WIN32 AND (BUILD_GAME_SERVER OR BUILD_LOGIN_SERVER OR BUILD_EXTRACTORS))
set(MYSQL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/lib/include/mysql")
set(MYSQL_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libmysql.lib")
set(MYSQL_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_debug/libmysql.lib")
if(SQLITE)
find_package(SQLite3 REQUIRED)
else()
set(MYSQL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/lib/include/mysql")
set(MYSQL_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libmysql.lib")
set(MYSQL_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_debug/libmysql.lib")
endif()
set(OPENSSL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/lib/include")
set(OPENSSL_LIBRARIES
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libcrypto.lib"
Expand Down
2 changes: 2 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
option(DEBUG "Include additional debug-code in core" OFF)
option(WARNINGS "Show all warnings during compile" OFF)
option(POSTGRESQL "Use PostgreSQL" OFF)
option(SQLITE "Use SQLite" OFF)
option(PCH "Use precompiled headers" ON)
option(BUILD_GAME_SERVER "Build game server" ON)
option(BUILD_LOGIN_SERVER "Build login server" ON)
Expand Down Expand Up @@ -31,6 +32,7 @@ message(STATUS
DEBUG Include additional debug-code in core
WARNINGS Show all warnings during compile
POSTGRESQL Use PostgreSQL instead of mysql
SQLITE Use SQLite instead of mysql
BUILD_GAME_SERVER Build game server (core server)
BUILD_LOGIN_SERVER Build login server (auth server)
BUILD_EXTRACTORS Build map/dbc/vmap/mmap extractor
Expand Down
2 changes: 2 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ConfVersion=2024020101
# ---PGSQL---
# hostname;port;username;password;database
# .;/path/to/unix_socket/DIRECTORY or . for default path;username;password;database - use Unix sockets at Unix/Linux
# ---SQLITE---
# /path/to/sqlite.db
#
# LoginDatabaseConnections
# WorldDatabaseConnections
Expand Down

0 comments on commit aa068d9

Please sign in to comment.