forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move protobuf support in drake/common into subdir
Bazel's support for protobuf does not have good backward compatibility. As such, its helpful an important build file (drake/common/BUILD) didn't mention @protobuf in a load() stanza. Thus, we'll move the protobuf support into a different package folder, so that only folks that truly need it have to pay for it with their WORKSPACE entries.
- Loading branch information
1 parent
51770a0
commit 651ef7b
Showing
29 changed files
with
123 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# -*- python -*- | ||
# This file contains rules for Bazel; see drake/doc/bazel.rst. | ||
|
||
load("//tools:cpplint.bzl", "cpplint") | ||
load( | ||
"//tools:drake.bzl", | ||
"drake_cc_googletest", | ||
"drake_cc_library", | ||
) | ||
load("@protobuf//:protobuf.bzl", "cc_proto_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_proto_library( | ||
name = "matlab_rpc", | ||
srcs = [ | ||
"matlab_rpc.proto", | ||
], | ||
testonly = 1, | ||
) | ||
|
||
drake_cc_library( | ||
name = "call_matlab", | ||
testonly = 1, | ||
srcs = ["call_matlab.cc"], | ||
hdrs = ["call_matlab.h"], | ||
deps = [ | ||
"//drake/common", | ||
":matlab_rpc", | ||
], | ||
) | ||
|
||
drake_cc_library( | ||
name = "protobuf", | ||
srcs = ["protobuf.cc"], | ||
hdrs = ["protobuf.h"], | ||
deps = [ | ||
"@protobuf", | ||
], | ||
) | ||
|
||
# === test/ === | ||
|
||
drake_cc_googletest( | ||
name = "call_matlab_test", | ||
deps = [ | ||
":call_matlab", | ||
], | ||
) | ||
|
||
drake_cc_googletest( | ||
name = "protobuf_test", | ||
data = [ | ||
"test/test_string.txt", | ||
], | ||
deps = [ | ||
":protobuf", | ||
], | ||
) | ||
|
||
cpplint() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS matlab_rpc.proto) | ||
|
||
set(sources | ||
${PROTO_SRCS} | ||
call_matlab.cc | ||
protobuf.cc | ||
) | ||
|
||
set(installed_headers | ||
${PROTO_HDRS} | ||
call_matlab.h | ||
protobuf.h | ||
) | ||
|
||
add_library_with_exports(LIB_NAME drakeCommonProto | ||
SOURCE_FILES ${sources} ${installed_headers}) | ||
target_include_directories(drakeCommonProto PUBLIC ${PROTOBUF_INCLUDE_DIRS}) | ||
target_link_libraries(drakeCommonProto | ||
${PROTOBUF_LIBRARIES} | ||
drakeCommon | ||
Eigen3::Eigen | ||
) | ||
set(drakeCommonProto_CFLAGS) | ||
set(drakeCommonProto_REQUIRES) | ||
|
||
drake_install_headers(${installed_headers}) | ||
drake_install_libraries(drakeCommonProto) | ||
|
||
# N.B. The tests are not built with CMake. |
2 changes: 1 addition & 1 deletion
2
drake/common/call_matlab.cc → drake/common/proto/call_matlab.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "drake/common/protobuf.h" | ||
#include "drake/common/proto/protobuf.h" | ||
|
||
#include <fcntl.h> | ||
|
||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
drake/common/test/call_matlab_test.cc → drake/common/proto/test/call_matlab_test.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "drake/common/call_matlab.h" | ||
#include "drake/common/proto/call_matlab.h" | ||
|
||
#include <cmath> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.