From b08e9a2f3a0322bb404dd6c7c278aff37ac1a128 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 22 Mar 2020 18:57:00 +0200 Subject: [PATCH] Make MySQL optional. Only windows for now. --- CMakeLists.txt | 1 + module/CMakeLists.txt | 4 +++- module/Vendor/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9212fe4..c086b0da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(SqMod) # Several plugin options option(BUILTIN_RUNTIMES "Include the MinGW runtime into the binary itself." ON) option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF) +option(ENABLE_MYSQL "Enable the MySQL library." OFF) # Default to c++14 standard if(CMAKE_VERSION VERSION_LESS "3.1") diff --git a/module/CMakeLists.txt b/module/CMakeLists.txt index c8c8c474..411f5554 100644 --- a/module/CMakeLists.txt +++ b/module/CMakeLists.txt @@ -77,7 +77,9 @@ target_link_libraries(SqModule VCMP Squirrel Sqrat SqSDK) # Link to third-party libraries target_link_libraries(SqModule SimpleINI HashLib B64Lib AES256Lib WhirlpoolLib TinyDir PUGIXML SQLite MaxmindDB) # Link to mysql client library -target_link_libraries(SqModule mariadbclient) +if(WIN32 AND ENABLE_MYSQL) + target_link_libraries(SqModule mariadbclient) +endif() # if(FORCE_32BIT_BIN) set_target_properties(SqModule PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") diff --git a/module/Vendor/CMakeLists.txt b/module/Vendor/CMakeLists.txt index c291c64f..2d1173c5 100644 --- a/module/Vendor/CMakeLists.txt +++ b/module/Vendor/CMakeLists.txt @@ -8,6 +8,6 @@ add_subdirectory(SQLite) add_subdirectory(TinyDir) add_subdirectory(Whirlpool) # Build our own mysql client on windows -if(WIN32) +if(WIN32 AND ENABLE_MYSQL) add_subdirectory(MDBC) -endif(WIN32) +endif()