Skip to content

Commit 35d9a53

Browse files
author
Michael Penick
committed
Merge remote-tracking branch 'riptano/1.10.1_prep' into 2.14.1_prep_merge
2 parents b339dd5 + 99839f7 commit 35d9a53

File tree

328 files changed

+5774
-26723
lines changed

Some content is hidden

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

328 files changed

+5774
-26723
lines changed

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ if(CASS_BUILD_STATIC)
151151
set(PC_REQUIRED_LIBS "${PC_REQUIRED_LIBS} openssl")
152152
endif()
153153

154-
# Update the test flags to indicate the use of the static library
155-
if(CASS_USE_STATIC_LIBS)
156-
set(TEST_CXX_FLAGS "${TEST_CXX_FLAGS} -DCASS_STATIC")
157-
set(CASS_TEST_CXX_FLAGS "${CASS_TEST_CXX_FLAGS} -DCASS_STATIC")
158-
endif()
159-
160154
set_property(TARGET ${PROJECT_LIB_NAME_STATIC} PROPERTY FOLDER "Driver/Cassandra")
161155
endif()
162156

appveyor.ps1

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Function Build-Configuration-Information {
6363
$output = @"
6464
Visual Studio: $($Env:CMAKE_GENERATOR.Split(" ")[-2]) [$($Env:CMAKE_GENERATOR.Split(" ")[-1])]
6565
Architecture: $($Env:Platform)
66-
Boost: v$($Env:BOOST_VERSION)
6766
libssh2: v$($Env:LIBSSH2_VERSION)
6867
libuv: v$($Env:LIBUV_VERSION)
6968
OpenSSL: v$(Get-OpenSSL-Version)
@@ -112,7 +111,6 @@ Function Environment-Information {
112111

113112
Function Initialize-Build-Environment {
114113
# Get the versions for the third party dependencies
115-
$boost_version = $Env:BOOST_VERSION
116114
$libssh2_version = $Env:LIBSSH2_VERSION
117115
$libuv_version = $Env:LIBUV_VERSION
118116
$openssl_version = Get-OpenSSL-Version
@@ -179,17 +177,15 @@ Function Initialize-Build-Environment {
179177
}
180178

181179
# Generate default environment variables for per commit builds
182-
$boost_version_filename = "$($boost_version.Replace(".", "_"))"
180+
If ($Env:APPVEYOR_BUILD_WORKER_IMAGE -Like "Visual Studio 2019") {
181+
$boost_version_directory_suffix = "1_71_0"
182+
} Else {
183+
$boost_version_directory_suffix = "1_69_0"
184+
}
183185
$visual_studio_version = "$($Env:VISUAL_STUDIO_INTERNAL_VERSION.Insert(2, "."))"
184186

185187
# Generate the default Boost environment variables
186-
$Env:BOOST_ROOT = "C:/Libraries/boost_$($boost_version_filename)"
187-
$Env:BOOST_LIBRARYDIR = "$($Env:BOOST_ROOT)/$($lib_architecture)-msvc-$($visual_studio_version)"
188-
If (-Not (Test-Path -Path "$($Env:BOOST_LIBRARYDIR)")) {
189-
# Update the Boost environment variables for CMake to find installation
190-
$Env:BOOST_ROOT = "$($libs_location_prefix)/boost-$($boost_version)"
191-
$Env:BOOST_LIBRARYDIR = "$($Env:BOOST_ROOT)/$($lib_architecture)-msvc-$($visual_studio_version)"
192-
}
188+
$Env:BOOST_ROOT = "C:/Libraries/boost_$($boost_version_directory_suffix)"
193189
$Env:BOOST_INCLUDEDIR = "$($Env:BOOST_ROOT)/include"
194190

195191
# Generate the default libssh2 environment variables
@@ -509,55 +505,6 @@ add_dependencies(`${PROJECT_NAME} `${ZLIB_LIBRARY_NAME})
509505
}
510506
}
511507

512-
# Handle installation of the per commit dependencies (e.g. Test builds)
513-
# Determine if Boost should be installed (pre-installed or cached)
514-
If (-Not (Test-Path -Path "$($Env:BOOST_LIBRARYDIR)")) {
515-
New-Item -ItemType Directory -Force -Path "$($dependencies_build_location_prefix)/boost" | Out-Null
516-
Push-Location -Path "$($dependencies_build_location_prefix)/boost"
517-
518-
$cmakelists_contents = @"
519-
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
520-
project(Boost)
521-
set(PROJECT_DISPLAY_NAME "AppVeyor CI Build for Boost")
522-
set(PROJECT_MODULE_DIR $cmake_modules_dir)
523-
set(CMAKE_MODULE_PATH `${CMAKE_MODULE_PATH} `${PROJECT_MODULE_DIR})
524-
include(ExternalProject-boost)
525-
set(GENERATED_SOURCE_FILE `${CMAKE_CURRENT_BINARY_DIR}/main.cpp)
526-
file(REMOVE `${GENERATED_SOURCE_FILE})
527-
file(WRITE `${GENERATED_SOURCE_FILE} "int main () { return 0; }")
528-
add_executable(`${PROJECT_NAME} `${GENERATED_SOURCE_FILE})
529-
add_dependencies(`${PROJECT_NAME} `${BOOST_LIBRARY_NAME})
530-
"@
531-
$cmakelists_contents | Out-File -FilePath "CMakeLists.txt" -Encoding Utf8 -Force
532-
533-
Write-Host "Configuring Boost"
534-
cmake -G "$($Env:CMAKE_GENERATOR)" -A $Env:CMAKE_PLATFORM "-DBOOST_VERSION=$($Env:BOOST_VERSION)" "-DBOOST_INSTALL_PREFIX=$($Env:BOOST_ROOT)" .
535-
If ($LastExitCode -ne 0) {
536-
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
537-
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "Boost Output Log"
538-
}
539-
If (Test-Path -Path "build/CMakeFiles/CMakeError.log") {
540-
Push-AppveyorArtifact "build/CMakeFiles/CMakeError.log" -DeploymentName "Boost Error Log"
541-
}
542-
Pop-Location
543-
Throw "Failed to configure Boost for MSVC $($Env:VISUAL_STUDIO_INTERNAL_VERSION)-$($Env:Platform)"
544-
}
545-
Write-Host "Building and Installing Boost"
546-
cmake --build . --config RelWithDebInfo
547-
If ($LastExitCode -ne 0) {
548-
If (Test-Path -Path "build/CMakeFiles/CMakeOutput.log") {
549-
Push-AppveyorArtifact "build/CMakeFiles/CMakeOutput.log" -DeploymentName "Boost Output Log"
550-
}
551-
If (Test-Path -Path "build/CMakeFiles/CMakeError.log") {
552-
Push-AppveyorArtifact "build/CMakeFiles/CMakeError.log" -DeploymentName "Boost Error Log"
553-
}
554-
Pop-Location
555-
Throw "Failed to build Boost for MSVC $($Env:VISUAL_STUDIO_INTERNAL_VERSION)-$($Env:Platform)"
556-
}
557-
558-
Pop-Location
559-
}
560-
561508
# Determine if libssh2 should be installed (cached)
562509
If (-Not (Test-Path -Path "$($Env:LIBSSH2_ROOT_DIR)/lib")) { # lib directory checked due to external project being CMake (automatically creates root directory)
563510
New-Item -ItemType Directory -Force -Path "$($dependencies_build_location_prefix)/libssh2" | Out-Null

appveyor.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ environment:
3737
secure: h28bN22Py3CZPqrWoZWEjIFnpes+kslusCKP1mRYdUqBEf+OO1kFEQTZ9DGD7tuCSIIRDI3Mf9LX8zgUdmdlZA==
3838
APPVEYOR_IGNORE_COMMIT_FILTERING_ON_TAG: true
3939
DRIVER_TYPE: CASS
40-
BOOST_VERSION: 1.69.0
4140
LIBSSH2_VERSION: 1.9.0
4241
LIBUV_VERSION: 1.33.0
4342
OPENSSL_1_0_VERSION: 1.0.2s
@@ -88,12 +87,10 @@ environment:
8887
OPENSSL_MAJOR_MINOR: 1.0
8988
VISUAL_STUDIO_INTERNAL_VERSION: 142
9089
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
91-
BOOST_VERSION: 1.70.0
9290
# - CMAKE_GENERATOR: Visual Studio 16 2019
9391
# OPENSSL_MAJOR_MINOR: 1.1
9492
# VISUAL_STUDIO_INTERNAL_VERSION: 142
9593
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
96-
# BOOST_VERSION: 1.70.0
9794
#init:
9895
# - ps: iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
9996
install:

bin/README.md

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

bin/vswhere.exe

-393 KB
Binary file not shown.

cmake/modules/CppDriver.cmake

Lines changed: 32 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ endmacro()
8888
# CassOptionalDependencies
8989
#
9090
# Configure enabled optional dependencies if found or if Windows use an
91-
# external project to build Boost, OpenSSL, zlib.
91+
# external project to build OpenSSL and zlib.
9292
#
9393
# Output: CASS_INCLUDES and CASS_LIBS
9494
#------------------------
9595
macro(CassOptionalDependencies)
9696
# Boost
97-
if(CASS_USE_BOOST_ATOMIC OR CASS_BUILD_INTEGRATION_TESTS)
97+
if(CASS_USE_BOOST_ATOMIC)
9898
CassUseBoost()
9999
endif()
100100

@@ -147,22 +147,22 @@ macro(CassConfigureShared prefix)
147147
set_target_properties(${PROJECT_LIB_NAME} PROPERTIES
148148
COMPILE_PDB_NAME "${PROJECT_LIB_NAME}"
149149
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
150-
set(STATIC_COMPILE_FLAGS "-D${prefix}_BUILDING")
150+
set(SHARED_COMPILE_FLAGS "-D${prefix}_BUILDING")
151151
if("${prefix}" STREQUAL "DSE")
152-
set(STATIC_COMPILE_FLAGS "${STATIC_COMPILE_FLAGS} -DCASS_BUILDING")
152+
set(SHARED_COMPILE_FLAGS "${SHARED_COMPILE_FLAGS} -DCASS_BUILDING")
153153
endif()
154154
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
155155
set_property(
156156
TARGET ${PROJECT_LIB_NAME}
157-
APPEND PROPERTY COMPILE_FLAGS "${STATIC_COMPILE_FLAGS} -Wconversion -Wno-sign-conversion -Wno-shorten-64-to-32 -Wno-undefined-var-template -Werror")
157+
APPEND PROPERTY COMPILE_FLAGS "${SHARED_COMPILE_FLAGS} -Wconversion -Wno-sign-conversion -Wno-shorten-64-to-32 -Wno-undefined-var-template -Werror")
158158
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # To many superfluous warnings generated with GCC when using -Wconversion (see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752)
159159
set_property(
160160
TARGET ${PROJECT_LIB_NAME}
161-
APPEND PROPERTY COMPILE_FLAGS "${STATIC_COMPILE_FLAGS} -Werror")
161+
APPEND PROPERTY COMPILE_FLAGS "${SHARED_COMPILE_FLAGS} -Werror")
162162
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
163163
set_property(
164164
TARGET ${PROJECT_LIB_NAME}
165-
APPEND PROPERTY COMPILE_FLAGS "${STATIC_COMPILE_FLAGS} /we4800")
165+
APPEND PROPERTY COMPILE_FLAGS "${SHARED_COMPILE_FLAGS} /we4800")
166166
endif()
167167
endmacro()
168168

@@ -204,8 +204,8 @@ macro(CassConfigureStatic prefix)
204204

205205
# Update the CXX flags to indicate the use of the static library
206206
if(${prefix}_USE_STATIC_LIBS)
207-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STATIC_COMPILE_FLAGS}")
208-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${STATIC_COMPILE_FLAGS}")
207+
set(TEST_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STATIC_COMPILE_FLAGS}") # Unit and integration test executables
208+
set(EXAMPLE_CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${STATIC_COMPILE_FLAGS}") # Example executables
209209
endif()
210210
endmacro()
211211

@@ -383,15 +383,8 @@ endmacro()
383383
# Input: CASS_BUILD_INTEGRATION_TESTS, CASS_BUILD_UNIT_TESTS, CASS_ROOT_DIR
384384
#------------------------
385385
macro(CassConfigureTests)
386-
if(CASS_BUILD_INTEGRATION_TESTS)
387-
# Add CCM bridge as a dependency for integration tests
388-
set(CCM_BRIDGE_INCLUDES "${CASS_ROOT_DIR}/test/ccm_bridge/src")
389-
add_subdirectory(${CASS_ROOT_DIR}/test/ccm_bridge)
390-
add_subdirectory(${CASS_ROOT_DIR}/test/integration_tests)
391-
endif()
392-
393386
if (CASS_BUILD_INTEGRATION_TESTS OR CASS_BUILD_UNIT_TESTS)
394-
add_subdirectory(${CASS_ROOT_DIR}/gtests)
387+
add_subdirectory(${CASS_ROOT_DIR}/tests)
395388
endif()
396389
endmacro()
397390

@@ -427,20 +420,32 @@ macro(CassUseLibuv)
427420
message(FATAL_ERROR "Unable to Locate libuv: libuv v1.0.0+ is required")
428421
endif()
429422

430-
if (LIBUV_VERSION VERSION_LESS "1.0")
423+
if(LIBUV_VERSION VERSION_LESS "1.0")
431424
message(FATAL_ERROR "Libuv version ${LIBUV_VERSION} is not "
432425
" supported. Please updgrade to libuv version 1.0 or greater in order to "
433426
"utilize the driver.")
434427
endif()
435428

436-
if (LIBUV_VERSION VERSION_LESS "1.6")
429+
if(LIBUV_VERSION VERSION_LESS "1.6")
437430
message(WARNING "Libuv version ${LIBUV_VERSION} does not support custom "
438431
"memory allocators (version 1.6 or greater required)")
439432
endif()
440433

441434
# Assign libuv include and libraries
442435
set(CASS_INCLUDES ${CASS_INCLUDES} ${LIBUV_INCLUDE_DIRS})
443436
set(CASS_LIBS ${CASS_LIBS} ${LIBUV_LIBRARIES})
437+
438+
# libuv and gtests require thread library
439+
set(CMAKE_THREAD_PREFER_PTHREAD 1)
440+
set(THREADS_PREFER_PTHREAD_FLAG 1)
441+
find_package(Threads REQUIRED)
442+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
443+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
444+
if(NOT WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.1.0")
445+
# FindThreads in CMake versions < v3.1.0 do not have the THREADS_PREFER_PTHREAD_FLAG to prefer -pthread
446+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
447+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
448+
endif()
444449
endmacro()
445450

446451
#------------------------
@@ -515,38 +520,13 @@ macro(CassHttpParser)
515520
include_directories(${HTTP_PARSER_INCLUDE_DIR})
516521
endmacro()
517522

518-
#------------------------
519-
# CassSimulacron
520-
#
521-
# Set up Simulacron for use in tests.
522-
#
523-
# Input: TESTS_SIMULACRON_SERVER_DIR
524-
# Output: SIMULACRON_SERVER_JAR
525-
#------------------------
526-
macro(CassSimulacron)
527-
# Determine if Simulacron server can be executed (Java runtime is available)
528-
find_package(Java COMPONENTS Runtime)
529-
if(Java_Runtime_FOUND)
530-
# Determine the Simulacron jar file
531-
file(GLOB SIMULACRON_SERVER_JAR
532-
${TESTS_SIMULACRON_SERVER_DIR}/simulacron-standalone-*.jar)
533-
endif()
534-
535-
# Determine if the Simulacron server will be available for the tests
536-
if(NOT EXISTS ${SIMULACRON_SERVER_JAR})
537-
message(WARNING "Simulacron Not Found: Simulacron support will be disabled")
538-
endif()
539-
endmacro()
540-
541-
542523
#------------------------
543524
# CassUseBoost
544525
#
545-
# Add includes, libraries, define flags required for using Boost if found or if
546-
# Windows use an external project to build Boost.
526+
# Add includes and define flags required for using Boost if found.
547527
#
548-
# Input: CASS_USE_STATIC_LIBS, CASS_USE_BOOST_ATOMIC, CASS_INCLUDES, CASS_LIBS
549-
# Output: CASS_INCLUDES and CASS_LIBS
528+
# Input: CASS_USE_BOOST_ATOMIC, CASS_INCLUDES
529+
# Output: CASS_INCLUDES
550530
#------------------------
551531
macro(CassUseBoost)
552532
# Allow for boost directory to be specified on the command line
@@ -568,64 +548,15 @@ macro(CassUseBoost)
568548
add_definitions(-DBOOST_ALL_NO_LIB)
569549
endif()
570550

571-
# Determine if shared or static boost libraries should be used
572-
if(CASS_USE_STATIC_LIBS OR
573-
(WIN32 AND CASS_BUILD_INTEGRATION_TESTS)) # Force the use of Boost static libraries for Windows (e.g. executables)
574-
set(Boost_USE_STATIC_LIBS ON)
575-
else()
576-
set(Boost_USE_STATIC_LIBS OFF)
577-
add_definitions(-DBOOST_ALL_DYN_LINK)
578-
endif()
579-
set(Boost_USE_STATIC_RUNTIME OFF)
580-
set(Boost_USE_MULTITHREADED ON)
581-
add_definitions(-DBOOST_THREAD_USES_MOVE)
582-
583551
# Check for general Boost availability
584552
find_package(Boost ${CASS_MINIMUM_BOOST_VERSION} QUIET)
585-
if ((WIN32 AND NOT Boost_FOUND) AND
586-
(CASS_USE_BOOST_ATOMIC OR CASS_BUILD_INTEGRATION_TESTS))
587-
message(STATUS "Unable to Locate Boost: Third party build step will be performed")
588-
include(ExternalProject-Boost)
589-
else()
590-
message(STATUS "Boost version: v${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
591-
# Ensure the driver components exist (optional)
592-
if(CASS_USE_BOOST_ATOMIC)
593-
if(NOT Boost_INCLUDE_DIRS)
594-
message(FATAL_ERROR "Boost headers required to build driver because of -DCASS_USE_BOOST_ATOMIC=On")
595-
endif()
596-
597-
# Assign Boost include for atomics
598-
set(CASS_INCLUDES ${CASS_INCLUDES} ${Boost_INCLUDE_DIRS})
553+
if(CASS_USE_BOOST_ATOMIC)
554+
if(NOT Boost_INCLUDE_DIRS)
555+
message(FATAL_ERROR "Boost headers required to build driver because of -DCASS_USE_BOOST_ATOMIC=On")
599556
endif()
600557

601-
# Determine if Boost components are available for test executables
602-
if(CASS_BUILD_INTEGRATION_TESTS)
603-
# Handle new required version of CMake for Boost v1.66.0 (Windows only)
604-
if(WIN32)
605-
if(Boost_FOUND)
606-
if(Boost_VERSION GREATER 106600 OR Boost_VERSION EQUAL 106600)
607-
# Ensure CMake version is v3.11.0+
608-
if(CMAKE_VERSION VERSION_LESS 3.11.0)
609-
message(FATAL_ERROR "Boost v${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} requires CMake v3.11.0+."
610-
"Updgrade CMake or downgrade Boost to v${CASS_MINIMUM_BOOST_VERSION} - v1.65.1.")
611-
endif()
612-
endif()
613-
endif()
614-
endif()
615-
616-
# Ensure Boost components are available
617-
find_package(Boost ${CASS_MINIMUM_BOOST_VERSION} COMPONENTS chrono system thread unit_test_framework)
618-
if(NOT Boost_FOUND)
619-
# Ensure Boost was not found due to minimum version requirement
620-
set(CASS_FOUND_BOOST_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
621-
if((CASS_FOUND_BOOST_VERSION VERSION_GREATER "${CASS_MINIMUM_BOOST_VERSION}")
622-
OR (CASS_FOUND_BOOST_VERSION VERSION_EQUAL "${CASS_MINIMUM_BOOST_VERSION}"))
623-
message(FATAL_ERROR "Boost [chrono, system, thread, and unit_test_framework] are required to build tests")
624-
else()
625-
message(FATAL_ERROR "Boost v${CASS_FOUND_BOOST_VERSION} Found: v${CASS_MINIMUM_BOOST_VERSION} or greater required")
626-
endif()
627-
endif()
628-
endif()
558+
# Assign Boost include for atomics
559+
set(CASS_INCLUDES ${CASS_INCLUDES} ${Boost_INCLUDE_DIRS})
629560
endif()
630561

631562
# Determine if additional Boost definitions are required for driver/executables

0 commit comments

Comments
 (0)