Skip to content

Commit 12ef4a9

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 82e81dd + 6b2fc10 commit 12ef4a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4802
-2028
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/INFO_SRC
22
/CMakeSettings.json
33
.vs
4+
out

CMakeLists.txt

Lines changed: 40 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
6565

6666
PROJECT(MySQL_CONCPP)
6767

68-
include(version.cmake)
69-
7068
# Load cmake modules
7169

7270
include(cdk/cmake/setup.cmake)
@@ -77,6 +75,26 @@ include(dependency) # find_dependency()
7775
include(config_options) # add_config_option()
7876
include(libutils) # merge_libraries()
7977

78+
#
79+
# Detect if we are configured as stand-alone project, or sub-project.
80+
#
81+
82+
if(PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME)
83+
84+
SET(concpp_stand_alone 1)
85+
86+
else()
87+
88+
MESSAGE("Building Connector/C++ as part of ${CMAKE_PROJECT_NAME} project")
89+
SET(concpp_stand_alone 0)
90+
set(WITH_TESTS OFF)
91+
set(WITH_DOC OFF)
92+
set(WITH_HEADER_CHECKS OFF)
93+
94+
endif()
95+
96+
include(version.cmake)
97+
8098
message("Building on system: ${CMAKE_SYSTEM} (${CMAKE_SYSTEM_PROCESSOR})")
8199
message("Using cmake generator: ${CMAKE_GENERATOR}")
82100
#message("Compiler identification: ${CMAKE_CXX_COMPILER_ID}")
@@ -105,12 +123,6 @@ else()
105123
endif()
106124

107125

108-
#
109-
# Connector System Configuration
110-
#
111-
include(config.cmake)
112-
113-
114126
#
115127
# Install settings
116128
# ================
@@ -336,6 +348,17 @@ add_config_option(WITH_JDBC BOOL DEFAULT OFF
336348

337349
if(WITH_JDBC)
338350
add_subdirectory(jdbc)
351+
352+
# Note: These include paths are to be used in a build tree. In
353+
# this situation the jdbc public headers are not installed yet and
354+
# we use a copy of them placed inside the build tree.
355+
356+
target_include_directories(connector-jdbc
357+
PUBLIC "${PROJECT_BINARY_DIR}/jdbc/cppconn"
358+
PUBLIC "${PROJECT_SOURCE_DIR}/include"
359+
PUBLIC "${PROJECT_BINARY_DIR}/jdbc/include/jdbc"
360+
)
361+
339362
endif()
340363

341364

@@ -367,12 +390,6 @@ if(MAINTAINER_MODE)
367390
endif(MAINTAINER_MODE)
368391

369392

370-
#
371-
# We use UUID generator taken from server sources.
372-
#
373-
374-
add_subdirectory(cdk/extra/uuid uuid)
375-
376393
#
377394
# Connector/C++ components
378395
#
@@ -428,6 +445,13 @@ add_custom_command(TARGET libconcpp POST_BUILD
428445
)
429446
endif()
430447

448+
#
449+
# Stop here if this is a sub-project of a bigger project.
450+
#
451+
452+
if (NOT concpp_stand_alone)
453+
return()
454+
endif()
431455

432456
#
433457
# Install specifications
@@ -500,18 +524,6 @@ if(BUILD_STATIC)
500524
add_definitions(-DSTATIC_CONCPP)
501525
endif()
502526

503-
504-
# Auto-generated test targets
505-
506-
IF (WITH_TESTS)
507-
# Unit tests declared with ADD_NG_TEST() (see cdk/cmake/testing.cmake)
508-
ADD_TEST_TARGET()
509-
510-
# Test for public headers declared with ADD_HEADERS()
511-
# (see cdk/cmake/headers.cmake)
512-
ADD_HEADERS_TEST()
513-
ENDIF (WITH_TESTS)
514-
515527
#
516528
# Sample code to try things out
517529
#
@@ -524,10 +536,6 @@ if(WITH_JDBC)
524536

525537
add_executable(try_jdbc EXCLUDE_FROM_ALL try_jdbc.cc)
526538
target_link_libraries(try_jdbc connector-jdbc)
527-
target_include_directories(try_jdbc
528-
PRIVATE "${PROJECT_BINARY_DIR}/include/mysql"
529-
PRIVATE "${PROJECT_BINARY_DIR}/include/jdbc/cppconn"
530-
)
531539

532540
endif()
533541

@@ -567,67 +575,11 @@ endif()
567575
endif()
568576

569577
#
570-
# Linking test
571-
# ------------
572-
#
573-
# This test compiles test application using internal installation of built
574-
# connector. It is important to work with installed files because otherwise
575-
# cmake does its magic to resolve missing dependencies when building test code.
576-
# We don't want this to happen to make sure that test code can be built with
577-
# connector library only, as we distribute it.
578+
# Other tests.
578579
#
579-
# Note: internal installation into <binary_dir>/install is done by directly
580-
# executing cmake_install.cmake script which is generated by cmake.
581-
#
582-
# TODO: Also test dynamic linking (requires adopting test app project)
583-
#
584-
585-
file(REMOVE_RECURSE ${PROJECT_BINARY_DIR}/link_test)
586-
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/link_test)
587580

588-
unset(jdbc_options)
589-
if(WITH_JDBC)
590-
#message("-- BOOST_ROOT: ${BOOST_ROOT}")
591-
list(APPEND jdbc_options -DWITH_JDBC=ON -DWITH_BOOST=${BOOST_ROOT})
592-
endif()
581+
include(testing/tests.cmake)
593582

594-
add_custom_target(link_test
595-
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_BINARY_DIR}/install
596-
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/install
597-
COMMAND ${CMAKE_COMMAND}
598-
-D CMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/install
599-
-D CMAKE_INSTALL_CONFIG_NAME=$<$<BOOL:$<CONFIGURATION>>:$<CONFIGURATION>>$<$<NOT:$<BOOL:$<CONFIGURATION>>>:Release>
600-
-P ${PROJECT_BINARY_DIR}/cmake_install.cmake
601-
COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/link_test/CMakeCache.txt
602-
COMMAND ${CMAKE_COMMAND}
603-
-G "${CMAKE_GENERATOR}"
604-
-D WITH_CONCPP=${PROJECT_BINARY_DIR}/install
605-
-D WITH_SSL="${WITH_SSL}"
606-
-D BUILD_STATIC=${BUILD_STATIC}
607-
-D STATIC_MSVCRT=${STATIC_MSVCRT}
608-
${jdbc_options}
609-
${PROJECT_SOURCE_DIR}/testapp
610-
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIGURATION> --clean-first
611-
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/link_test
612-
VERBATIM
613-
)
614-
615-
set_target_properties(link_test PROPERTIES FOLDER "Tests")
616-
617-
add_dependencies(link_test connector)
618-
#if(TARGET connector-merge)
619-
# add_dependencies(link_test connector-merge)
620-
#endif()
621-
#if(WITH_JDBC)
622-
# add_dependencies(link_test build_jdbc)
623-
#endif()
624-
625-
# TDOD: Use ${CMAKE_COMMAND}, but evaluated at test time, not here.
626-
627-
add_test(NAME Link_test
628-
COMMAND cmake --build . --target link_test --config $<CONFIGURATION>
629-
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
630-
)
631583

632584
#
633585
# Create the INFO_SRC and INFO_BIN files

CTestConfig.cmake

Lines changed: 0 additions & 44 deletions
This file was deleted.

LICENSE.txt

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Introduction
1010
third-party software which may be included in this distribution of
1111
MySQL Connector/C++ 8.0.
1212

13-
Last updated: March 2020
13+
Last updated: June 2020
1414

1515
Licensing Information
1616

@@ -33,8 +33,7 @@ Licensing Information
3333
a copy of which is reproduced below and can also be found along with
3434
its FAQ at http://oss.oracle.com/licenses/universal-foss-exception.
3535

36-
Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights
37-
reserved.
36+
Copyright (c) 2008, 2020, Oracle and/or its affiliates.
3837

3938
Election of GPLv2
4039

@@ -921,33 +920,38 @@ zlib
921920
Oracle gratefully acknowledges the contributions of Jean-loup Gailly
922921
and Mark Adler in creating the zlib general purpose compression library
923922
which is used in this product.
924-
zlib.h -- interface of the 'zlib' general purpose compression library
925-
Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler
926-
927-
zlib.h -- interface of the 'zlib' general purpose compression library
928-
version 1.2.3, July 18th, 2005
929-
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
930-
931-
zlib.h -- interface of the 'zlib' general purpose compression library
932-
version 1.2.5, April 19th, 2010
933-
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
934-
935-
This software is provided 'as-is', without any express or implied warranty.
936-
In no event will the authors be held liable for any damages arising from the
937-
use of this software. Permission is granted to anyone to use this software
938-
for any purpose,including commercial applications, and to alter it and
939-
redistribute it freely, subject to the following restrictions:
940-
941-
1. The origin of this software must not be misrepresented; you must not
942-
claim that you wrote the original software. If you use this software
943-
in a product, an acknowledgment in the product documentation would
944-
be appreciated but is not required.
945-
2. Altered source versions must be plainly marked as such, and must not
946-
be misrepresented as being the original software.
947-
3. This notice may not be removed or altered from any source distribution.
948-
949-
Jean-loup Gailly [email protected]
950-
923+
(C) 1995-2017 Jean-loup Gailly and Mark Adler
924+
925+
This software is provided 'as-is', without any express or implied
926+
warranty. In no event will the authors be held liable for any damages
927+
arising from the use of this software.
928+
929+
Permission is granted to anyone to use this software for any purpose,
930+
including commercial applications, and to alter it and redistribute it
931+
freely, subject to the following restrictions:
932+
933+
934+
1. The origin of this software must not be misrepresented; you must not
935+
claim that you wrote the original software. If you use this software
936+
in a product, an acknowledgment in the product documentation would be
937+
appreciated but is not required.
938+
939+
2. Altered source versions must be plainly marked as such, and must not be
940+
misrepresented as being the original software.
941+
942+
3. This notice may not be removed or altered from any source distribution.
943+
944+
Jean-loup Gailly Mark Adler
945+
946+
947+
If you use the zlib library in a product, we would appreciate *not* receiving
948+
lengthy legal documents to sign. The sources are provided for free but without
949+
warranty of any kind. The library has been entirely written by Jean-loup
950+
Gailly and Mark Adler; it does not include third-party code.
951+
952+
If you redistribute modified sources, we would appreciate that you include in
953+
the file ChangeLog history information documenting your changes. Please read
954+
the FAQ for more information on the distribution of modified source versions.
951955

952956
ZSTD
953957

buildinfo.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ FUNCTION(GENERATE_INFO_SRC)
100100
MESSAGE("Generating INFO_SRC")
101101

102102
IF (NOT EXISTS INFO_SRC)
103-
SET(INFO_VERSION "${CONCPP_PACKAGE_VERSION}")
103+
SET(INFO_VERSION "${CONCPP_VERSION}")
104104

105105
find_program(GIT_FOUND NAMES git)
106106

cdk/extra/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ endif()
3636
enable_pic()
3737
add_subdirectory(zlib)
3838

39+
# Note: zlib writes configuration header into build location
40+
# and this location needs to be added to include path when
41+
# using zlib.
42+
3943
target_include_directories(zlib PUBLIC
40-
${PROJECT_BINARY_DIR}/extra/zlib
41-
${PROJECT_SOURCE_DIR}/extra/zlib
44+
${CMAKE_CURRENT_BINARY_DIR}/zlib
45+
zlib
4246
)
4347

4448

@@ -55,7 +59,4 @@ target_include_directories(lz4 PUBLIC lz4)
5559

5660
add_subdirectory(zstd)
5761

58-
target_include_directories(zstd PUBLIC
59-
${PROJECT_BINARY_DIR}/extra/zstd/lib
60-
${PROJECT_SOURCE_DIR}/extra/zstd/lib
61-
)
62+
target_include_directories(zstd PUBLIC zstd/lib)

0 commit comments

Comments
 (0)