Skip to content

Commit adeadf3

Browse files
committed
Just delete mysqlconncpp entirely
Delete FindMySQLConnectorCPP Get rid of FindMySQL and use Boost.Mysql libmysqlcppconn-dev is a hacky uncomplete unbuntu library with custom file staging that's incompatible with modern setups (include/jdbc) so grab official binaries instead and install directly into cmake.
1 parent 9396102 commit adeadf3

File tree

17 files changed

+332
-356
lines changed

17 files changed

+332
-356
lines changed

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ set(version_file "${CMAKE_CURRENT_BINARY_DIR}/Version.cpp")
9898
find_package(Botan 2.14.0 REQUIRED)
9999
include_directories(${BOTAN_INCLUDE_DIRS})
100100

101-
##############################
102-
# MySQL Connector C++ #
103-
##############################
104-
find_package(MySQLConnectorCPP REQUIRED)
105-
include_directories(${MYSQLCCPP_INCLUDE_DIRS})
106-
107101
##############################
108102
# FlatBuffers #
109103
##############################

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LABEL description="Development build environment"
66
# Update the distro and install our tools
77
RUN apt-get -y update && apt-get -y upgrade \
88
&& apt-get -y install software-properties-common \
9-
&& apt-get -y install wget \
9+
&& apt-get -y install wget tar \
1010
# GCC stuff
1111
&& apt-get -y install build-essential gcc-14 g++-14 \
1212
# Clang stuff
@@ -23,14 +23,14 @@ RUN apt-get -y update && apt-get -y upgrade \
2323
&& apt-get -y install git \
2424
# Install required library packages
2525
&& apt-get install -y libbotan-2-dev \
26-
&& apt-get install -y libmysqlcppconn-dev \
26+
&& apt-get install -y libssl-dev \
2727
&& apt-get install -y zlib1g-dev \
2828
&& apt-get install -y libpcre3-dev \
2929
&& apt-get install -y libflatbuffers-dev \
3030
&& wget -q https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.gz \
3131
&& tar -zxf boost_1_88_0.tar.gz \
3232
&& cd boost_1_88_0 \
33-
&& ./bootstrap.sh --with-libraries=system,program_options,headers \
33+
&& ./bootstrap.sh --with-libraries=mysql,system,program_options,headers \
3434
&& ./b2 link=static install -d0 -j $(nproc) cxxflags="-std=c++23"
3535

3636
# Copy source
@@ -42,7 +42,7 @@ WORKDIR ${working_dir}
4242
# These can be overriden by passing them through to `docker build`
4343
ARG build_optional_tools=1
4444
ARG disable_threads=0
45-
ARG build_type=Rel
45+
ARG build_type=Debug
4646
ARG install_dir=/usr/local/bin
4747

4848
# Generate Makefile & compile

cmake/FindMySQLConnectorCPP.cmake

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/account/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ set(LIBRARY_SRC
2525
include_directories(${SPARK_INCLUDES_DIR})
2626

2727
add_library(${LIBRARY_NAME} ${LIBRARY_HDR} ${LIBRARY_SRC})
28-
target_link_libraries(${LIBRARY_NAME} PRIVATE spark conpool logger shared ${MYSQLCCPP_LIBRARY}
29-
${BOTAN_LIBRARY} ${Boost_LIBRARIES} Threads::Threads FB_SCHEMA_COMPILE)
28+
target_link_libraries(${LIBRARY_NAME} spark conpool logger shared ${Boost_LIBRARIES}
29+
${BOTAN_LIBRARY} Threads::Threads FB_SCHEMA_COMPILE)
3030
target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_BINARY_DIR})
3131

3232
add_executable(${EXECUTABLE_NAME} main.cpp)

src/character/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ set(LIBRARY_SRC
2424
include_directories(${CMAKE_SOURCE_DIR}/deps/utf8cpp)
2525

2626
add_library(${LIBRARY_NAME} ${LIBRARY_HDR} ${LIBRARY_SRC})
27-
target_link_libraries(${LIBRARY_NAME} dbcreader spark logger protocol shared ${BOTAN_LIBRARY}
28-
${Boost_LIBRARIES} Threads::Threads FB_SCHEMA_COMPILE)
27+
target_link_libraries(${LIBRARY_NAME} dbcreader spark logger protocol shared ${Boost_LIBRARIES}
28+
${BOTAN_LIBRARY} Threads::Threads FB_SCHEMA_COMPILE)
2929
target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_BINARY_DIR})
3030

3131
add_executable(${EXECUTABLE_NAME} main.cpp)
3232
target_link_libraries(${EXECUTABLE_NAME} ${LIBRARY_NAME} protocol dbcreader spark conpool logger shared
33-
${MYSQLCCPP_LIBRARY} ${Boost_LIBRARIES} Threads::Threads)
33+
${Boost_LIBRARIES} Threads::Threads)
3434

3535
INSTALL(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
3636
set_target_properties(character PROPERTIES FOLDER "Services/Applications")

src/gateway/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ set(LIBRARY_SRC
8585

8686
add_library(${LIBRARY_NAME} ${LIBRARY_HDR} ${LIBRARY_SRC})
8787
add_dependencies(${LIBRARY_NAME} FB_SCHEMA_COMPILE)
88-
target_link_libraries(${LIBRARY_NAME} PRIVATE ${Boost_LIBRARIES} PRIVATE nsd conpool stun ports dbcreader protocol spark
89-
logger shared ${ZLIB_LIBRARY} ${BOTAN_LIBRARY} Threads::Threads)
88+
target_link_libraries(${LIBRARY_NAME} nsd conpool stun ports dbcreader protocol spark logger shared
89+
${Boost_LIBRARIES} ${BOTAN_LIBRARY} ${ZLIB_LIBRARY} Threads::Threads)
9090
target_include_directories(${LIBRARY_NAME} PUBLIC ${CMAKE_BINARY_DIR})
9191

9292
add_executable(${EXECUTABLE_NAME} main.cpp)

src/libs/conpool/include/conpool/drivers/MySQL/Driver.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014 - 2024 Ember
2+
* Copyright (c) 2014 - 2025 Ember
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -18,12 +18,19 @@
1818
#include <string_view>
1919
#include <utility>
2020
#include <cstdint>
21+
#include <boost/mysql.hpp>
22+
#include <boost/asio/io_context.hpp>
2123

2224
namespace sql {
2325

24-
class Driver;
25-
class Connection;
26-
class PreparedStatement;
26+
using Connection = boost::mysql::tcp_connection;
27+
using PreparedStatement = boost::mysql::statement;
28+
29+
class Driver {
30+
public:
31+
std::string getName() const { return "Boost.MySQL"; }
32+
std::tuple<int, int, int> getVersion() const { return std::make_tuple(0, 0, 0); }
33+
};
2734

2835
} // sql
2936

@@ -75,10 +82,8 @@ class MySQL final {
7582
bool clean(sql::Connection* conn) const;
7683
void close(sql::Connection* conn) const;
7784
bool keep_alive(sql::Connection* conn) const;
78-
void thread_enter() const;
79-
void thread_exit() const;
8085
sql::PreparedStatement* prepare_cached(sql::Connection* conn, std::string key);
8186
sql::PreparedStatement* prepare_cached(sql::Connection* conn, std::string_view key);
8287
};
8388

84-
} // drivers, ember
89+
} // drivers, ember

0 commit comments

Comments
 (0)