/[packages]/updates/8/mysql-connector-c++/current/SOURCES/mysql-connector-cpp-use-system-protobuf.patch
ViewVC logotype

Contents of /updates/8/mysql-connector-c++/current/SOURCES/mysql-connector-cpp-use-system-protobuf.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1769473 - (show annotations) (download)
Sat Jan 22 22:37:03 2022 UTC (2 years, 3 months ago) by neoclust
File size: 3579 byte(s)
SILENT: Add patches
1 diff -uNr mysql-connector-c++-8.0.20-org/cdk/CMakeLists.txt mysql-connector-c++-8.0.20-src/cdk/CMakeLists.txt
2 --- mysql-connector-c++-8.0.20-org/cdk/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200
3 +++ mysql-connector-c++-8.0.20-src/cdk/CMakeLists.txt 2020-05-13 18:37:49.147107797 +0300
4 @@ -97,6 +97,7 @@
5 #find_dependency(Protobuf)
6 find_dependency(RapidJSON)
7 find_dependency(Coverage)
8 +find_package(Protobuf REQUIRED)
9
10
11 # TODO: These macros should not be used in public headers because they are
12 diff -uNr mysql-connector-c++-8.0.20-org/cdk/core/CMakeLists.txt mysql-connector-c++-8.0.20-src/cdk/core/CMakeLists.txt
13 --- mysql-connector-c++-8.0.20-org/cdk/core/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200
14 +++ mysql-connector-c++-8.0.20-src/cdk/core/CMakeLists.txt 2020-05-13 18:37:49.147107797 +0300
15 @@ -45,7 +45,7 @@
16
17 target_link_libraries(cdk
18 PUBLIC cdk_mysqlx cdk_parser
19 - PRIVATE ext::pb-lite # required by codecc.cc
20 + PRIVATE protobuf::libprotobuf-lite # required by codecc.cc
21 )
22
23 add_coverage(cdk)
24 diff -uNr mysql-connector-c++-8.0.20-org/cdk/protocol/mysqlx/CMakeLists.txt mysql-connector-c++-8.0.20-src/cdk/protocol/mysqlx/CMakeLists.txt
25 --- mysql-connector-c++-8.0.20-org/cdk/protocol/mysqlx/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200
26 +++ mysql-connector-c++-8.0.20-src/cdk/protocol/mysqlx/CMakeLists.txt 2020-05-13 18:37:49.151107769 +0300
27 @@ -109,6 +109,65 @@
28
29 endif(NOT use_full_protobuf)
30
31 +function(mysqlx_protobuf_generate_cpp SRCS HDRS)
32 +
33 + IF(NOT ARGN)
34 + MESSAGE(SEND_ERROR
35 + "Error: MYSQLX_PROTOBUF_GENERATE_CPP() called without any proto files")
36 + RETURN()
37 + ENDIF()
38 +
39 + SET(srcs)
40 + SET(hdrs)
41 +
42 + FOREACH(FIL ${ARGN})
43 +
44 + GET_FILENAME_COMPONENT(ABS_FIL ${FIL} ABSOLUTE)
45 + GET_FILENAME_COMPONENT(FIL_WE ${FIL} NAME_WE)
46 + GET_FILENAME_COMPONENT(ABS_PATH ${ABS_FIL} PATH)
47 +
48 + LIST(APPEND srcs "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.cc")
49 + LIST(APPEND hdrs "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h")
50 +
51 + ADD_CUSTOM_COMMAND(
52 + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.cc"
53 + "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h"
54 + COMMAND ${CMAKE_COMMAND}
55 + -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/protobuf"
56 + COMMAND protobuf::protoc
57 + ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/protobuf"
58 + -I ${ABS_PATH} ${ABS_FIL}
59 + DEPENDS ${ABS_FIL} #${PROTOBUF_PROTOC_EXECUTABLE}
60 + COMMENT "Running C++ protocol buffer compiler on ${FIL}"
61 + VERBATIM
62 + )
63 +
64 + ENDFOREACH()
65 +
66 + SET_SOURCE_FILES_PROPERTIES(
67 + ${srcs} ${hdrs}
68 + PROPERTIES GENERATED TRUE)
69 +
70 + #
71 + # Disable compile warnings in code generated by Protobuf
72 + #
73 +
74 + IF(UNIX)
75 + set_source_files_properties(${srcs}
76 + APPEND_STRING PROPERTY COMPILE_FLAGS "-w"
77 + )
78 + ELSE(WIN32)
79 + set_source_files_properties(${srcs}
80 + APPEND_STRING PROPERTY COMPILE_FLAGS
81 + "/W1 /wd4018 /wd4996 /wd4244 /wd4267"
82 + )
83 + ENDIF()
84 +
85 +
86 + SET(${SRCS} ${srcs} PARENT_SCOPE)
87 + SET(${HDRS} ${hdrs} PARENT_SCOPE)
88 +
89 +endfunction(mysqlx_protobuf_generate_cpp)
90
91 mysqlx_protobuf_generate_cpp(PB_SRCS PB_HDRS ${proto_mysqlx_defs})
92
93 @@ -130,9 +187,9 @@
94 )
95
96 if(use_full_protobuf)
97 - target_link_libraries(cdk_proto_mysqlx PRIVATE ext::pb-full)
98 + target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf::libprotobuf)
99 else()
100 - target_link_libraries(cdk_proto_mysqlx PRIVATE ext::pb-lite)
101 + target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf::libprotobuf-lite)
102 endif()
103
104 target_link_libraries(cdk_proto_mysqlx

  ViewVC Help
Powered by ViewVC 1.1.30