Skip to content

Commit

Permalink
Create and install bot_core_lcmtypes C bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Jun 15, 2017
1 parent da057e6 commit 5052810
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
8 changes: 7 additions & 1 deletion tools/bot2-core-lcmtypes.cps
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
},
"Default-Components": [":lcmtypes_bot2-core-cpp"],
"Components": {
"lcmtypes_bot2-core": {
"Type": "dylib",
"Includes": ["@prefix@/include/lcmtypes"],
"Location": "@prefix@/lib/libbot_core_lcmtypes_c.so",
"Requires": ["lcm:lcm-coretypes"]
},
"lcmtypes_bot2-core-cpp": {
"Type": "interface",
"Includes": ["@prefix@/include/lcmtypes"],
"Requires": ["lcm:lcm-coretypes"]
},
"lcmtypes_bot2-core-java": {
"Type": "jar",
"Location": "@prefix@/share/java/lcmtypes_bot2-core-java.jar",
"Location": "@prefix@/share/java/libbot_core_lcmtypes_java.jar",
"Requires": ["lcm:lcm-java"]
}
}
Expand Down
25 changes: 22 additions & 3 deletions tools/bot_core_lcmtypes.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

package(default_visibility = ["//visibility:public"])

load("@drake//tools:install.bzl", "cmake_config", "install", "install_cmake_config")
load("@drake//tools:lcm.bzl", "lcm_cc_library", "lcm_java_library", "lcm_py_library")
load(
"@drake//tools:install.bzl",
"cmake_config",
"install",
"install_cmake_config",
)
load(
"@drake//tools:lcm.bzl",
"lcm_c_library",
"lcm_cc_library",
"lcm_java_library",
"lcm_py_library",
)

LCM_SRCS = glob(["lcmtypes/*.lcm"])

Expand All @@ -13,13 +24,20 @@ LCM_STRUCTS = [
for f in LCM_SRCS
]

lcm_c_library(
name = "bot_core_lcmtypes_c",
includes = ["lcmtypes"],
lcm_package = "bot_core",
lcm_srcs = LCM_SRCS,
lcm_structs = LCM_STRUCTS,
)

lcm_cc_library(
name = "bot_core_lcmtypes",
includes = ["lcmtypes"],
lcm_package = "bot_core",
lcm_srcs = LCM_SRCS,
lcm_structs = LCM_STRUCTS,
linkstatic = 0,
)

lcm_java_library(
Expand Down Expand Up @@ -56,6 +74,7 @@ install(
py_strip_prefix = ["lcmtypes"],
targets = [
":bot_core_lcmtypes",
":bot_core_lcmtypes_c",
":bot_core_lcmtypes_java",
":bot_core_lcmtypes_py",
],
Expand Down
5 changes: 0 additions & 5 deletions tools/lcm.bzl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# -*- python -*-

load(
"@drake//tools:generate_include_header.bzl",
"drake_generate_include_header",
)

def _lcm_outs(lcm_srcs, lcm_package, lcm_structs, extension):
"""Return the list of lcm-gen output filenames (derived from the lcm_srcs,
lcm_package, and lcm_struct parameters as documented in lcm_cc_library
Expand Down

0 comments on commit 5052810

Please sign in to comment.