From 505281039fc33f8d733a17dcb5247c80d3c11e14 Mon Sep 17 00:00:00 2001 From: Jamie Snape Date: Thu, 15 Jun 2017 12:31:15 -0400 Subject: [PATCH] Create and install bot_core_lcmtypes C bindings --- tools/bot2-core-lcmtypes.cps | 8 +++++++- tools/bot_core_lcmtypes.BUILD | 25 ++++++++++++++++++++++--- tools/lcm.bzl | 5 ----- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/tools/bot2-core-lcmtypes.cps b/tools/bot2-core-lcmtypes.cps index 49ea50f1fb87..cfb3bfdc8687 100644 --- a/tools/bot2-core-lcmtypes.cps +++ b/tools/bot2-core-lcmtypes.cps @@ -11,6 +11,12 @@ }, "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"], @@ -18,7 +24,7 @@ }, "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"] } } diff --git a/tools/bot_core_lcmtypes.BUILD b/tools/bot_core_lcmtypes.BUILD index 12eb2b2345d6..4962d58262e1 100644 --- a/tools/bot_core_lcmtypes.BUILD +++ b/tools/bot_core_lcmtypes.BUILD @@ -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"]) @@ -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( @@ -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", ], diff --git a/tools/lcm.bzl b/tools/lcm.bzl index ab39c821b965..2c4ae9d8c300 100644 --- a/tools/lcm.bzl +++ b/tools/lcm.bzl @@ -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