2022-08-04 02:58:02 +08:00
|
|
|
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libmysql")
|
2018-03-14 18:18:12 +08:00
|
|
|
message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.")
|
2017-01-25 10:25:38 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
if("openssl" IN_LIST FEATURES AND "schannel" IN_LIST FEATURES)
|
|
|
|
message(FATAL_ERROR "Only one SSL backend must be selected.")
|
|
|
|
endif()
|
|
|
|
|
2018-03-14 18:18:12 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-04-03 03:46:30 +08:00
|
|
|
REPO mariadb-corporation/mariadb-connector-c
|
2024-10-01 06:15:24 +08:00
|
|
|
REF v${VERSION}
|
|
|
|
SHA512 396ce2a36937d49ec96eb239312118c736f46383d2906b7142d9695e795f310af28255d8827cc98ad76ae4e6d5a22faf1188b7dd286791e3c85f22c96d0114b3
|
|
|
|
HEAD_REF 3.4
|
2019-05-24 12:44:54 +08:00
|
|
|
PATCHES
|
2024-10-01 06:15:24 +08:00
|
|
|
compiler-flags.diff
|
|
|
|
dependencies.diff
|
|
|
|
disable-mariadb_config.diff
|
|
|
|
library-linkage.diff
|
|
|
|
cmake-export.diff
|
|
|
|
no-abs-path.diff
|
|
|
|
ushort-check.diff
|
|
|
|
)
|
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${SOURCE_PATH}/cmake/FindIconv.cmake"
|
|
|
|
"${SOURCE_PATH}/external/zlib"
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
2020-08-06 05:03:22 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-08-04 02:58:02 +08:00
|
|
|
FEATURES
|
2022-09-13 04:50:09 +08:00
|
|
|
iconv WITH_ICONV
|
2022-10-09 12:38:15 +08:00
|
|
|
zstd WITH_ZSTD
|
2020-08-06 05:03:22 +08:00
|
|
|
)
|
|
|
|
|
2024-10-01 06:15:24 +08:00
|
|
|
string(TOUPPER "${VCPKG_LIBRARY_LINKAGE}" plugin_type)
|
|
|
|
|
|
|
|
set(zstd_plugin_type OFF)
|
|
|
|
if("zstd" IN_LIST FEATURES)
|
|
|
|
set(zstd_plugin_type ${plugin_type})
|
|
|
|
endif()
|
|
|
|
|
2020-10-27 12:00:50 +08:00
|
|
|
if("openssl" IN_LIST FEATURES)
|
2021-07-23 07:19:26 +08:00
|
|
|
set(WITH_SSL OPENSSL)
|
2021-11-18 07:33:26 +08:00
|
|
|
elseif("schannel" IN_LIST FEATURES)
|
|
|
|
set(WITH_SSL ON)
|
2020-10-27 12:00:50 +08:00
|
|
|
else()
|
2021-07-23 07:19:26 +08:00
|
|
|
set(WITH_SSL OFF)
|
2020-10-27 12:00:50 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-03-14 18:18:12 +08:00
|
|
|
OPTIONS
|
2020-08-06 05:03:22 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2024-10-01 06:15:24 +08:00
|
|
|
-DCMAKE_POLICY_DEFAULT_CMP0153=OLD
|
|
|
|
-DINSTALL_INCLUDEDIR=include/mysql # legacy port decision
|
2021-11-18 07:33:26 +08:00
|
|
|
-DINSTALL_LIBDIR=lib
|
|
|
|
-DINSTALL_PLUGINDIR=plugins/${PORT}
|
2018-03-14 18:18:12 +08:00
|
|
|
-DWITH_CURL=OFF
|
2021-11-18 07:33:26 +08:00
|
|
|
-DWITH_EXTERNAL_ZLIB=ON
|
2020-10-27 12:00:50 +08:00
|
|
|
-DWITH_SSL=${WITH_SSL}
|
2024-10-01 06:15:24 +08:00
|
|
|
-DWITH_UNIT_TESTS=OFF
|
|
|
|
# plugins/auth
|
|
|
|
-DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF
|
|
|
|
-DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=${plugin_type}
|
|
|
|
-DCLIENT_PLUGIN_CLIENT_ED25519=DYNAMIC # want ${plugin_type}, but STATIC fails
|
|
|
|
-DCLIENT_PLUGIN_DIALOG=${plugin_type}
|
|
|
|
-DCLIENT_PLUGIN_PARSEC=OFF
|
|
|
|
-DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=${plugin_type}
|
|
|
|
-DCLIENT_PLUGIN_MYSQL_OLD_PASSWORD=OFF
|
|
|
|
-DCLIENT_PLUGIN_SHA256_PASSWORD=${plugin_type}
|
|
|
|
# plugins/compress
|
|
|
|
-DCLIENT_PLUGIN_ZSTD=${zstd_plugin_type}
|
|
|
|
# don't add system include dirs
|
2021-11-18 07:33:26 +08:00
|
|
|
-DAUTH_GSSAPI_PLUGIN_TYPE=OFF
|
2024-10-01 06:15:24 +08:00
|
|
|
-DREMOTEIO_PLUGIN_TYPE=OFF
|
2021-11-18 07:33:26 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
AUTH_GSSAPI_PLUGIN_TYPE
|
2024-10-01 06:15:24 +08:00
|
|
|
CLIENT_PLUGIN_AUTH_GSSAPI_CLIENT
|
|
|
|
CLIENT_PLUGIN_PARSEC
|
|
|
|
CLIENT_PLUGIN_ZSTD
|
2017-01-20 17:06:11 +08:00
|
|
|
)
|
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmariadb)
|
2024-10-01 06:15:24 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2017-01-20 17:06:11 +08:00
|
|
|
|
2024-10-01 06:15:24 +08:00
|
|
|
set(link_lib " -lmariadb")
|
2021-11-18 07:33:26 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
2024-10-01 06:15:24 +08:00
|
|
|
set(link_lib " -llibmariadb")
|
|
|
|
endif()
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(APPEND link_lib "client")
|
|
|
|
endif()
|
|
|
|
if(NOT link_lib STREQUAL " -lmariadb")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libmariadb.pc" " -lmariadb" "${link_lib}")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libmariadb.pc" " -lmariadb" "${link_lib}")
|
2021-11-18 07:33:26 +08:00
|
|
|
endif()
|
2021-07-23 07:19:26 +08:00
|
|
|
endif()
|
2022-08-04 02:58:02 +08:00
|
|
|
|
2021-11-18 07:33:26 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-01-20 17:06:11 +08:00
|
|
|
|
2024-10-01 06:15:24 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.LIB")
|