diff --git a/.gitmodules b/.gitmodules index 9e06961..41fe645 100644 --- a/.gitmodules +++ b/.gitmodules @@ -55,3 +55,6 @@ [submodule "third_party/protobuf"] path = third_party/protobuf url = https://github.com/google/protobuf.git +[submodule "third_party/mysqlconnector"] + path = third_party/mysqlconnector + url = https://github.com/mysql/mysql-connector-cpp.git diff --git a/third_party/build_mysqlconnector.sh b/third_party/build_mysqlconnector.sh new file mode 100755 index 0000000..38325fb --- /dev/null +++ b/third_party/build_mysqlconnector.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +source ../scripts/build_helper.sh + +library_path="mysqlconnector" +requires_rebuild ${library_path} +[[ $? -eq 0 ]] && exit 0 + +cd ${library_path} +HEADER=$(cat cdk/foundation/connection_openssl.cc) +if ! [[ "${HEADER:0:34}" == "#if !defined(SSL_ERROR_WANT_ASYNC)" ]]; then + echo "Creating new one!" + echo "#if !defined(SSL_ERROR_WANT_ASYNC) + #define SSL_ERROR_WANT_ASYNC 0xFFEEDDCC +#endif +#if !defined(SSL_ERROR_WANT_ASYNC_JOB) + #define SSL_ERROR_WANT_ASYNC_JOB 0xFFEECCDD +#endif +`cat cdk/foundation/connection_openssl.cc`" > cdk/foundation/connection_openssl.cc +fi +cd .. + +cmake_build ${library_path} -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -I../../boringssl/include/" -DWITH_JDBC=ON -DWITH_SSL="`pwd`/../../boringssl/" -DOPENSSL_ROOT_DIR="`pwd`/../../boringssl/" -DCMAKE_BUILD_TYPE=RelWithDebInfo +check_err_exit ${library_path} "Failed to build mysqlconnector!" +set_build_successful ${library_path} \ No newline at end of file diff --git a/third_party/mysqlconnector b/third_party/mysqlconnector new file mode 160000 index 0000000..7abcdc8 --- /dev/null +++ b/third_party/mysqlconnector @@ -0,0 +1 @@ +Subproject commit 7abcdc88c8235f02096e21b5bcd72e8312508f61