Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dliw
mysql-connector-cpp
mysql-connector-cpp-use-system-protobuf.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mysql-connector-cpp-use-system-protobuf.patch of Package mysql-connector-cpp
diff -uNr mysql-connector-c++-8.0.20-org/cdk/CMakeLists.txt mysql-connector-c++-8.0.20-src/cdk/CMakeLists.txt --- mysql-connector-c++-8.0.20-org/cdk/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200 +++ mysql-connector-c++-8.0.20-src/cdk/CMakeLists.txt 2020-05-13 18:37:49.147107797 +0300 @@ -97,6 +97,7 @@ #find_dependency(Protobuf) find_dependency(RapidJSON) find_dependency(Coverage) +find_package(Protobuf REQUIRED) # TODO: These macros should not be used in public headers because they are diff -uNr mysql-connector-c++-8.0.20-org/cdk/core/CMakeLists.txt mysql-connector-c++-8.0.20-src/cdk/core/CMakeLists.txt --- mysql-connector-c++-8.0.20-org/cdk/core/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200 +++ mysql-connector-c++-8.0.20-src/cdk/core/CMakeLists.txt 2020-05-13 18:37:49.147107797 +0300 @@ -45,7 +45,7 @@ target_link_libraries(cdk PUBLIC cdk_mysqlx cdk_parser - PRIVATE ext::pb-lite # required by codecc.cc + PRIVATE protobuf::libprotobuf-lite # required by codecc.cc ) add_coverage(cdk) 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 --- mysql-connector-c++-8.0.20-org/cdk/protocol/mysqlx/CMakeLists.txt 2020-03-13 22:10:58.000000000 +0200 +++ mysql-connector-c++-8.0.20-src/cdk/protocol/mysqlx/CMakeLists.txt 2020-05-13 18:37:49.151107769 +0300 @@ -109,6 +109,65 @@ endif(NOT use_full_protobuf) +function(mysqlx_protobuf_generate_cpp SRCS HDRS) + + IF(NOT ARGN) + MESSAGE(SEND_ERROR + "Error: MYSQLX_PROTOBUF_GENERATE_CPP() called without any proto files") + RETURN() + ENDIF() + + SET(srcs) + SET(hdrs) + + FOREACH(FIL ${ARGN}) + + GET_FILENAME_COMPONENT(ABS_FIL ${FIL} ABSOLUTE) + GET_FILENAME_COMPONENT(FIL_WE ${FIL} NAME_WE) + GET_FILENAME_COMPONENT(ABS_PATH ${ABS_FIL} PATH) + + LIST(APPEND srcs "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.cc") + LIST(APPEND hdrs "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h") + + ADD_CUSTOM_COMMAND( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.cc" + "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h" + COMMAND ${CMAKE_COMMAND} + -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/protobuf" + COMMAND protobuf::protoc + ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/protobuf" + -I ${ABS_PATH} ${ABS_FIL} + DEPENDS ${ABS_FIL} #${PROTOBUF_PROTOC_EXECUTABLE} + COMMENT "Running C++ protocol buffer compiler on ${FIL}" + VERBATIM + ) + + ENDFOREACH() + + SET_SOURCE_FILES_PROPERTIES( + ${srcs} ${hdrs} + PROPERTIES GENERATED TRUE) + + # + # Disable compile warnings in code generated by Protobuf + # + + IF(UNIX) + set_source_files_properties(${srcs} + APPEND_STRING PROPERTY COMPILE_FLAGS "-w" + ) + ELSE(WIN32) + set_source_files_properties(${srcs} + APPEND_STRING PROPERTY COMPILE_FLAGS + "/W1 /wd4018 /wd4996 /wd4244 /wd4267" + ) + ENDIF() + + + SET(${SRCS} ${srcs} PARENT_SCOPE) + SET(${HDRS} ${hdrs} PARENT_SCOPE) + +endfunction(mysqlx_protobuf_generate_cpp) mysqlx_protobuf_generate_cpp(PB_SRCS PB_HDRS ${proto_mysqlx_defs}) @@ -130,9 +187,9 @@ ) if(use_full_protobuf) - target_link_libraries(cdk_proto_mysqlx PRIVATE ext::pb-full) + target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf::libprotobuf) else() - target_link_libraries(cdk_proto_mysqlx PRIVATE ext::pb-lite) + target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf::libprotobuf-lite) endif() target_link_libraries(cdk_proto_mysqlx
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor