Skip to content

Commit 4cf9811

Browse files
committed
Merge branch 'refs/heads/master' into wl13563-vs2019
2 parents 8e4dd61 + ef2f3ca commit 4cf9811

File tree

6 files changed

+48
-27
lines changed

6 files changed

+48
-27
lines changed

cdk/cmake/compiler/CLANG.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929

3030
function(enable_cxx11)
3131

32+
add_flags(CXX -std=c++11)
33+
3234
#
33-
# If Clang is used and deployment target is not specified
35+
# If Clang is used on macOS and deployment target is not specified
3436
# with MACOSX_DEPLOYMENT_TARGET environment variable, make
3537
# sure that clang's native implementation of C++ std
3638
# libarary (libc++) is used. Otherwise clang defaults to
@@ -41,7 +43,9 @@ function(enable_cxx11)
4143
# so.
4244
#
4345

44-
add_flags(CXX -std=c++11 -stdlib=libc++)
46+
if (MACOS)
47+
add_flags(CXX -stdlib=libc++)
48+
endif()
4549

4650
endfunction()
4751

cdk/include/mysql/cdk/mysqlx/session.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ class Session
440440

441441
private:
442442

443-
friend Stmt_op;
444-
445443
// Send Connection Attributes
446444
void send_connection_attr(const Options &options);
447445
// Authentication (cdk::protocol::mysqlx::Auth_processor)

cdk/parser/tokenizer.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,6 @@ bool Tokenizer::iterator::parse_quotted_string(char qchar)
421421
*/
422422

423423

424-
namespace {
425-
426-
// Note: be independent from the system locale settings.
427-
428-
std::locale c_loc("C");
429-
const std::ctype<char> &ctf = std::use_facet<std::ctype<char>>(c_loc);
430-
431-
}
432-
433424
std::locale char_iterator::m_cloc("C");
434425

435426

common/result.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,26 @@ class Result_impl
10231023
if(!m_result_mdata.empty())
10241024
m_result_mdata.pop();
10251025
if (!m_result_cache.empty())
1026+
{
1027+
/*
1028+
At this point m_cache_it can point inside the last entry of
1029+
m_result_cache that is just to be removed. Such dangling iterator
1030+
can cause issues when later it is assigned to a new value (as
1031+
compiler thinks it is still pointing inside old container and might
1032+
want to do some cleanups). To avoid dangling iterator, we reset it
1033+
to something neutral here.
1034+
1035+
Note: This "fix" works under assumption that "one past the end"
1036+
iterator is compatible between different containers, which seems to
1037+
be the case for all compilers we use.
1038+
1039+
TODO: A better solution would be to use std::option<> type for
1040+
m_cache_it.
1041+
*/
1042+
1043+
m_cache_it = m_result_cache.back().end();
10261044
m_result_cache.pop();
1045+
}
10271046
if (!m_result_cache_size.empty())
10281047
m_result_cache_size.pop();
10291048
}

testapp/CMakeLists.txt

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,14 @@ PROJECT(MySQL_CONCPP_TEST)
4040
# BUILD_STATIC whether to link with connector statically
4141
# or dynamically (the default)
4242
#
43-
# WITH_SSL tells if connector uses built-in SSL implementation
44-
# or relies on external OpenSSL libraries (*)
43+
# WITH_SSL if we use static linking with connector, we may have
44+
# to pass path to openssl package
4545
#
4646
# WITH_JDBC also build JDBC API test application
4747
#
4848
# WITH_BOOST where to look for Boost (required only when building
4949
# JDBC API application)
5050
#
51-
# *) If WITH_SSL is set to "builtin" or if it points at WoflSSL sources then
52-
# it is assumed that connector has SSL support built-in. In all other cases
53-
# it is assumed that connector uses OpenSSL libraries.
5451
#
5552
# Note: Either WITH_CONCPP or CONCPP_INCLUDE_DIR and CONCPP_LIB_DIR must be
5653
# set.
@@ -125,13 +122,21 @@ set(WITH_SSL $ENV{WITH_SSL} CACHE STRING
125122
"Set to 'builtin' if connector was built with built-in SSL support"
126123
)
127124

128-
if(NOT WITH_SSL)
129-
# Set to the default if WITH_SSL is not defined
130-
set(WITH_SSL "system")
131-
elseif(EXISTS "${WITH_SSL}/wolfssl/openssl/ssl.h")
132-
set(WITH_SSL "builtin")
125+
if(NOT WITH_SSL MATCHES "^(system|yes)$")
126+
127+
if(EXISTS ${WITH_SSL}/include/openssl/ssl.h)
128+
set(OPENSSL_ROOT_DIR "${WITH_SSL}")
129+
endif()
130+
133131
endif()
134132

133+
find_package(OpenSSL)
134+
135+
if(OPENSSL_FOUND)
136+
MESSAGE(STATUS "OPENSSL_VERSION = ${OPENSSL_VERSION}")
137+
MESSAGE(STATUS "OPENSSL_SSL_LIBRARY = ${OPENSSL_SSL_LIBRARY}")
138+
MESSAGE(STATUS "OPENSSL_CRYPTO_LIBRARY = ${OPENSSL_CRYPTO_LIBRARY}")
139+
endif()
135140

136141
option(WITH_JDBC "Also build the JDBC API test application" OFF)
137142

@@ -288,10 +293,11 @@ if(NOT WIN32)
288293
# link to them too.
289294
#
290295

291-
if(NOT WITH_SSL STREQUAL "builtin")
296+
if(OPENSSL_FOUND)
292297
set_property(TARGET MySQL::conncpp
293-
APPEND PROPERTY INTERFACE_LINK_LIBRARIES ssl crypto
294-
)
298+
APPEND PROPERTY INTERFACE_LINK_LIBRARIES
299+
${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}
300+
)
295301
endif()
296302

297303
endif()
@@ -398,9 +404,12 @@ endif()
398404
add_executable(devapi_test devapi_test.cc)
399405
target_link_libraries(devapi_test MySQL::conncpp)
400406

407+
408+
401409
add_executable(xapi_test xapi_test.c)
402410
target_link_libraries(xapi_test MySQL::conncpp)
403411

412+
404413
#
405414
# Note: Connector/C++ library depends on C++ runtime library.
406415
# For that reason, even code that is otherwise plain C, should

0 commit comments

Comments
 (0)