Skip to content

Commit

Permalink
[chore] Windows: Update MariaDB C connector
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Oct 12, 2023
1 parent 9e02ca2 commit 0b8c87e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ TestResults

# Build results
build/
build*/
lbuild/
build_mariadb_32/
build_mariadb_64/
out/
[Dd]ebug/
[Rr]elease/
Expand Down
32 changes: 30 additions & 2 deletions cmake/FindMariaDB.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
if(WIN32)
# How to build MariaDB Libs:
#
# <Clear your cache>
# It's easier to do this in two fresh build folders, so create build_mariadb_32 and build_mariadb_64 folders
# in your project root
#
# cd to build_mariadb_32
#
# cmake -A Win32 -DCMAKE_BUILD_TYPE=Release -DBUILD_MARIADB_FROM_SOURCE=ON ..
# cmake --build . --config Release --target libmariadb
# cmake --build . --config Release --target copy_mariadb_dll_to_ext
#
# <Clear your cache>
# cd to build_mariadb_64
#
# cmake -A x64 -DCMAKE_BUILD_TYPE=Release -DBUILD_MARIADB_FROM_SOURCE=ON ..
# cmake --build . --config Release --target libmariadb
Expand All @@ -16,13 +19,38 @@ if(WIN32)
# Remove any non-".h" files from the include folder
#
# Use tools/rename_dll.py to properly rename the x64 dll and lib to libmariadb64.lib/.dll
# From repo root in a vsvars/MSVC developer command prompt:
# .\tools\rename_dll.py .\ext\mariadb\lib64\libmariadb.dll libmariadb64.dll x64
# Rename libmariadb.dll to libmariadb64.dll (the previous step only handles the .lib)
#
# Move the x86 and x64 dlls into the repo root
#
# TEST AND MAKE SURE THAT EVERYTHING STILL WORKS!
#
# You can now delete build_mariadb_32 and build_mariadb_64

if(BUILD_MARIADB_FROM_SOURCE)
message(STATUS "BUILDING MARIADB FROM SOURCE!")

add_definitions(-DBUILD_STATIC_CURL)
CPMAddPackage(
NAME curl
GITHUB_REPOSITORY curl/curl
GIT_TAG 1f7d8cd478f024bc16cad204a9b62feb6e92a0c5
)

add_definitions(-DZSTD_BUILD_STATIC)
CPMAddPackage(
NAME ZSTD
GITHUB_REPOSITORY facebook/zstd
GIT_TAG c692b8d12d08eb3e460f99b43a7568ebbcb27acb
SOURCE_SUBDIR build/cmake
OPTIONS
"ZSTD_LEGACY_SUPPORT OFF"
)
link_libraries(libzstd_static)

message(STATUS "Adding mariadb")
CPMAddPackage(
NAME mariadb
GITHUB_REPOSITORY mariadb-corporation/mariadb-connector-c
Expand Down
Binary file modified ext/mariadb/lib/libmariadb.lib
Binary file not shown.
Binary file added ext/mariadb/lib64/libmariadb.lib
Binary file not shown.
Binary file modified libmariadb.dll
Binary file not shown.
Binary file modified libmariadb64.dll
Binary file not shown.

0 comments on commit 0b8c87e

Please sign in to comment.