mirror of
https://github.com/mariadb-corporation/mariadb-connector-cpp.git
synced 2025-08-15 20:45:46 +00:00
Moved cmake option defaults to the separate file
Added bit definition server param array(bulk) capability Enabled WITH_SIGNCODE option for cmake. It depends on DEVELOPER_ID option.
This commit is contained in:
@ -44,7 +44,7 @@ jobs:
|
||||
os: windows
|
||||
language: shell
|
||||
- if: type = push AND fork = false
|
||||
env: srv=mariadb-es v=10.3
|
||||
env: srv=mariadb v=10.3
|
||||
- if: type = push AND fork = false
|
||||
env: srv=mariadb-es v=10.4
|
||||
- if: type = push AND fork = false
|
||||
|
@ -332,13 +332,7 @@ ELSE()
|
||||
MESSAGE(STATUS "Found math lib: ${LIB_MATH}")
|
||||
SET(PLATFORM_DEPENDENCIES ${LIB_MATH})
|
||||
ENDIF()
|
||||
MACRO(ADD_OPTION _name _text _default)
|
||||
IF(NOT DEFINED ${_name})
|
||||
OPTION(${OPT}${_name} "${_text}" "${_default}")
|
||||
ELSE()
|
||||
OPTION(${OPT}${_name} "${_text}" "${${_name}}")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# This has to be before C/C's cmake run, or it will build with /MD
|
||||
IF(WIN32)
|
||||
IF (MSVC)
|
||||
@ -365,14 +359,15 @@ IF(WIN32)
|
||||
SET(PLATFORM_DEPENDENCIES ${PLATFORM_DEPENDENCIES} version.lib)
|
||||
ENDIF()
|
||||
|
||||
### Build options, initial settings and platform defaults
|
||||
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/options_defaults.cmake")
|
||||
|
||||
### Setting installation paths - should go before C/C subproject sets its own. We need to have control over those
|
||||
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/install.cmake")
|
||||
MESSAGE(STATUS "Libraries installation dir: ${INSTALL_LIB_SUFFIX}")
|
||||
MESSAGE(STATUS "Authentication Plugins installation dir: ${INSTALL_PLUGINDIR}")
|
||||
|
||||
IF(WIN32)
|
||||
ADD_OPTION(WITH_MSI "Build MSI installation package" ON)
|
||||
ADD_OPTION(WITH_SIGNCODE "Digitally sign files" OFF)
|
||||
MESSAGE(STATUS "Generate MSI package: ${WITH_MSI}")
|
||||
MESSAGE(STATUS "Sign MSI package: ${WITH_SIGNCODE}")
|
||||
ENDIF()
|
||||
|
79
cmake/options_defaults.cmake
Normal file
79
cmake/options_defaults.cmake
Normal file
@ -0,0 +1,79 @@
|
||||
#
|
||||
# Copyright (C) 2021-2022 MariaDB Corporation AB
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
IF(WIN32)
|
||||
OPTION(WITH_MSI "Build MSI installation package" ON)
|
||||
OPTION(WITH_SIGNCODE "Digitally sign files" OFF)
|
||||
|
||||
OPTION(MARIADB_LINK_DYNAMIC "Link Connector/C library dynamically" OFF)
|
||||
OPTION(ALL_PLUGINS_STATIC "Compile all plugins in, i.e. make them static" OFF)
|
||||
ELSE()
|
||||
OPTION(WITH_MSI "Build MSI installation package" OFF)
|
||||
IF(APPLE)
|
||||
OPTION(MARIADB_LINK_DYNAMIC "Link Connector/C library dynamically" OFF)
|
||||
OPTION(WITH_SIGNCODE "Digitally sign files" OFF)
|
||||
ELSE()
|
||||
OPTION(MARIADB_LINK_DYNAMIC "Link Connector/C library dynamically" ON)
|
||||
ENDIF()
|
||||
OPTION(ALL_PLUGINS_STATIC "Compile all plugins in, i.e. make them static" OFF)
|
||||
ENDIF()
|
||||
|
||||
OPTION(WITH_SSL "Enables use of TLS/SSL library" ON)
|
||||
OPTION(WITH_UNIT_TESTS "Build test suite" ON)
|
||||
OPTION(USE_SYSTEM_INSTALLED_LIB "Use installed in the syctem C/C library and do not build one" OFF)
|
||||
# This is to be used for some testing scenarious, obviously. e.g. testing of the connector installation.
|
||||
OPTION(BUILD_TESTS_ONLY "Build only tests and nothing else" OFF)
|
||||
|
||||
IF(BUILD_TESTS_ONLY)
|
||||
SET(WITH_UNIT_TESTS ON)
|
||||
ENDIF()
|
||||
IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||
SET(WITH_UNIT_TESTS OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_UNIT_TESTS)
|
||||
SET_VALUE(TEST_HOST "tcp://localhost:3306" "Defines Unit Tests default server")
|
||||
SET_VALUE(TEST_SCHEMA "test" "Defines Unit Tests default Database")
|
||||
SET_VALUE(TEST_UID "root" "Defines Unit Tests default login user")
|
||||
SET_VALUE(TEST_PASSWORD "root" "Defines Unit Tests default login user password")
|
||||
SET_VALUE(TEST_USETLS "false" "Defines useTls option value to use in tests")
|
||||
|
||||
IF("${TEST_USETLS}" STREQUAL "")
|
||||
SET(TEST_USETLS "false")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb)
|
||||
SET(USE_SYSTEM_INSTALLED_LIB ON)
|
||||
ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
|
||||
CMAKE_POLICY(SET CMP0042 NEW)
|
||||
CMAKE_POLICY(SET CMP0068 NEW)
|
||||
SET(CMAKE_INSTALL_RPATH "")
|
||||
SET(CMAKE_INSTALL_NAME_DIR "")
|
||||
SET(CMAKE_MACOSX_RPATH ON)
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
# Currently limiting this feature to Windows only, where it's most probably going to be only used
|
||||
IF(ALL_PLUGINS_STATIC)
|
||||
SET(CLIENT_PLUGIN_AUTH_GSSAPI_CLIENT "STATIC")
|
||||
SET(CLIENT_PLUGIN_DIALOG "STATIC")
|
||||
SET(CLIENT_PLUGIN_CLIENT_ED25519 "STATIC")
|
||||
SET(CLIENT_PLUGIN_CACHING_SHA2_PASSWORD "STATIC")
|
||||
SET(CLIENT_PLUGIN_SHA256_PASSWORD "STATIC")
|
||||
SET(CLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD "STATIC")
|
||||
SET(CLIENT_PLUGIN_MYSQL_OLD_PASSWORD "STATIC")
|
||||
SET(MARIADB_LINK_DYNAMIC OFF)
|
||||
ENDIF()
|
||||
ENDIF()
|
@ -100,12 +100,12 @@ IF(PKG)
|
||||
SET(CPACK_PRODUCTBUILD_IDENTIFIER "com.mariadb.connector.cpp")
|
||||
|
||||
#SET(PRODUCT_SERIES "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
|
||||
#IF(WITH_SIGNCODE)
|
||||
IF(WITH_SIGNCODE)
|
||||
# SET(SIGN_WITH_DEVID "--sign \"Developer ID Installer: ${DEVELOPER_ID}\"")
|
||||
# SET(CPACK_PRODUCTBUILD_IDENTITY_NAME "Developer ID Installer: ${DEVELOPER_ID}")
|
||||
#ELSE()
|
||||
SET(CPACK_PRODUCTBUILD_IDENTITY_NAME "Developer ID Installer: ${DEVELOPER_ID}")
|
||||
ELSE()
|
||||
# SET(SIGN_WITH_DEVID "")
|
||||
#ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/distribution.plist.in
|
||||
# ${CMAKE_CURRENT_BINARY_DIR}/distribution.plist @ONLY)
|
||||
|
@ -63,6 +63,9 @@ struct MariaDbServerCapabilities {
|
||||
1LL << 32; /* Client support progress indicator (since 10.2) */
|
||||
static const int64_t MARIADB_CLIENT_COM_MULTI =
|
||||
1LL << 33; /* bundle command during connection */
|
||||
static const int64_t _MARIADB_CLIENT_STMT_BULK_OPERATIONS =
|
||||
1LL << 34; /* support of array binding */
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -350,6 +350,9 @@ namespace capi
|
||||
// - avoid INSERT FROM SELECT
|
||||
// **************************************************************************************
|
||||
|
||||
if ((serverCapabilities & MariaDbServerCapabilities::_MARIADB_CLIENT_STMT_BULK_OPERATIONS) == 0)
|
||||
return false;
|
||||
|
||||
SQLString sql(origSql);
|
||||
// ensure that type doesn't change
|
||||
std::vector<Shared::ParameterHolder> initParameters= parametersList.front();
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# 2020 MariaDB Corporation AB
|
||||
# 2020, 2022 MariaDB Corporation AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License, version 2.0, as
|
||||
@ -27,17 +27,7 @@
|
||||
# along with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#Use Options to configure default test server params
|
||||
|
||||
SET_VALUE(TEST_HOST "tcp://localhost:3306" "Defines Unit Tests default server")
|
||||
SET_VALUE(TEST_SCHEMA "test" "Defines Unit Tests default Database")
|
||||
SET_VALUE(TEST_UID "root" "Defines Unit Tests default login user")
|
||||
SET_VALUE(TEST_PASSWORD "root" "Defines Unit Tests default login user password")
|
||||
SET_VALUE(TEST_USETLS "false" "Defines useTls option value to use in tests")
|
||||
|
||||
IF("${TEST_USETLS}" STREQUAL "")
|
||||
SET(TEST_USETLS "false")
|
||||
ENDIF()
|
||||
#default test server params configured in options_defaults.cmake
|
||||
|
||||
configure_file(tests_config.h.in
|
||||
${CMAKE_BINARY_DIR}/test/tests_config.h)
|
||||
|
Reference in New Issue
Block a user