Skip to content

Commit 7628fd3

Browse files
committed
Include all changes made on 10.2
1 parent 06b3715 commit 7628fd3

19 files changed

+1712
-1592
lines changed

storage/connect/CMakeLists.txt

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,21 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
4040
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
4141
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT )
4242

43-
macro(DISABLE_WARNING W)
44-
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-error=${W}")
45-
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-${W}" DEBUG)
46-
endmacro()
4743

4844
#
4945
# OS specific C flags, definitions and source files.
5046
#
5147
IF(UNIX)
5248
MY_CHECK_AND_SET_COMPILER_FLAG("-Wall -Wmissing-declarations")
5349
if(NOT WITH_WARNINGS)
54-
DISABLE_WARNING("unused-function")
55-
DISABLE_WARNING("unused-variable")
56-
DISABLE_WARNING("unused-value")
57-
DISABLE_WARNING("parentheses")
58-
DISABLE_WARNING("strict-aliasing")
59-
DISABLE_WARNING("misleading-indentation")
60-
DISABLE_WARNING("format-truncation")
61-
DISABLE_WARNING("implicit-fallthrough")
62-
DISABLE_WARNING("type-limits")
50+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-function")
51+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-variable")
52+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-value")
53+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-parentheses")
54+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing")
55+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-misleading-indentation")
56+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-format-truncation")
57+
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
6358
endif(NOT WITH_WARNINGS)
6459

6560
add_definitions( -DUNIX -DLINUX -DUBUNTU )
@@ -73,6 +68,10 @@ ELSE(NOT UNIX)
7368
tabwmi.cpp tabwmi.h tabmac.cpp tabmac.h macutil.cpp macutil.h)
7469
# Add exception handling to the CONNECT project)
7570
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
71+
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
72+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
73+
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
74+
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
7675
SET(IPHLPAPI_LIBRARY iphlpapi.lib)
7776
IF(MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES Clang))
7877
# Connect does not work with clang-cl
@@ -118,7 +117,6 @@ IF(CONNECT_WITH_LIBXML2)
118117
FIND_PACKAGE(LibXml2)
119118
IF (LIBXML2_FOUND)
120119
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
121-
SET(ZLIB_LIBRARY "z") # see ZLIB_INCLUDE_DIR below
122120
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
123121
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
124122
add_definitions(-DLIBXML2_SUPPORT)
@@ -173,8 +171,7 @@ IF(CONNECT_WITH_ODBC)
173171
# the library 'libiodbc' gets compiled with 'sql'h.
174172
# This will also need changes in the sources (e.g. #include <isql.h>).
175173

176-
find_file(ODBC_INCLUDES sql.h
177-
PATHS
174+
find_path(ODBC_INCLUDE_DIR sql.h
178175
/usr/include
179176
/usr/include/odbc
180177
/usr/local/include
@@ -184,7 +181,7 @@ IF(CONNECT_WITH_ODBC)
184181
#"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include"
185182
#"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
186183
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include"
187-
DOC "Specify the path to sql.h."
184+
DOC "Specify the directory containing sql.h."
188185
)
189186

190187
find_library(ODBC_LIBRARY
@@ -203,10 +200,9 @@ IF(CONNECT_WITH_ODBC)
203200
DOC "Specify the ODBC driver manager library here."
204201
)
205202

206-
mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDES)
203+
mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR)
207204

208-
IF(ODBC_INCLUDES AND ODBC_LIBRARY)
209-
get_filename_component(ODBC_INCLUDE_DIR "${ODBC_INCLUDES}" PATH)
205+
IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY)
210206
set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY})
211207
set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR})
212208
CHECK_CXX_SOURCE_COMPILES(
@@ -316,19 +312,25 @@ ENDIF(CONNECT_WITH_MONGO)
316312
# REST
317313
#
318314

319-
#OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
315+
OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
320316

321317
IF(CONNECT_WITH_REST)
322318
MESSAGE(STATUS "=====> REST support is ON")
323319
FIND_PACKAGE(cpprestsdk)
324320
IF (cpprestsdk_FOUND)
325321
MESSAGE(STATUS "=====> cpprestsdk found")
322+
IF(UNIX)
323+
# INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
324+
# If needed edit next line to set the path to libcpprest.so
325+
SET(REST_LIBRARY -lcpprest)
326+
MESSAGE (STATUS ${REST_LIBRARY})
327+
ENDIF(UNIX)
326328
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
327329
add_definitions(-DREST_SUPPORT)
328330
ELSE(NOT cpprestsdk_FOUND)
329331
MESSAGE(STATUS "=====> cpprestsdk package not found")
330332
ENDIF (cpprestsdk_FOUND)
331-
ENDIF(CONNECT_WITH_ZIP)
333+
ENDIF(CONNECT_WITH_REST)
332334

333335
#
334336
# XMAP
@@ -349,41 +351,32 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
349351
COMPONENT connect-engine
350352
RECOMPILE_FOR_EMBEDDED
351353
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
352-
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY})
354+
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY} ${REST_LIBRARY})
353355

354356
IF(NOT TARGET connect)
355357
RETURN()
356358
ENDIF()
357359

358-
# Don't link with bundled zlib and systel libxml2 at the same time.
359-
# System libxml2 uses system zlib, might conflict with the bundled one.
360-
IF (XML_LIBRARY AND BUILD_BUNDLED_ZLIB)
361-
GET_PROPERTY(INCS TARGET connect PROPERTY INCLUDE_DIRECTORIES)
362-
LIST(REMOVE_ITEM INCS ${ZLIB_INCLUDE_DIR})
363-
SET_PROPERTY(TARGET connect PROPERTY INCLUDE_DIRECTORIES ${INCS})
364-
ENDIF()
365-
366360
IF(WIN32)
367361
IF (libmongoc-1.0_FOUND)
368-
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
369-
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
362+
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
363+
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
370364
ENDIF(libmongoc-1.0_FOUND)
365+
ENDIF(WIN32)
371366

372367
# Install some extra files that belong to connect engine
373-
374-
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
368+
IF(WIN32)
369+
# install ha_connect.lib
370+
GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION)
371+
STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION})
372+
IF(CMAKE_CONFIGURATION_TYPES)
373+
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
374+
CONNECT_LIB ${CONNECT_LIB})
375+
ENDIF()
376+
INSTALL(FILES ${CONNECT_LIB}
375377
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
376378
ENDIF(WIN32)
377379

378-
IF(MSVC)
379-
# Temporarily disable "conversion from size_t .."
380-
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
381-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
382-
ENDIF()
383-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
384-
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
385-
ENDIF()
386-
387380
IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
388381
# TODO: Find how to compile and install the java wrapper classes
389382
# Find required libraries and include directories
@@ -394,3 +387,4 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
394387
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
395388
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
396389
ENDIF()
390+

0 commit comments

Comments
 (0)