Skip to content

Commit

Permalink
Add visibility control to all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 12, 2020
1 parent cf27ce0 commit 596892f
Show file tree
Hide file tree
Showing 249 changed files with 2,668 additions and 736 deletions.
10 changes: 8 additions & 2 deletions tesseract/tesseract/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.5.0)
project(tesseract VERSION 0.1.0 LANGUAGES CXX)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

find_package(Eigen3 REQUIRED)
find_package(Boost COMPONENTS system REQUIRED)
find_package(console_bridge REQUIRED)
find_package(tesseract_scene_graph REQUIRED)
Expand All @@ -20,7 +24,8 @@ add_code_coverage_all_targets(EXCLUDE ${COVERAGE_EXCLUDE})
tesseract_variables()

# Create target
add_library(${PROJECT_NAME} SHARED src/tesseract.cpp src/manipulator_manager.cpp)
add_library(${PROJECT_NAME} src/tesseract.cpp src/manipulator_manager.cpp)
target_process_export(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} PUBLIC
tesseract::tesseract_urdf
tesseract::tesseract_scene_graph
Expand All @@ -32,6 +37,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
tesseract::tesseract_command_language
console_bridge)
target_compile_options(${PROJECT_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(${PROJECT_NAME} ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION})
target_code_coverage(${PROJECT_NAME} ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})
Expand All @@ -40,7 +46,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
"$<INSTALL_INTERFACE:include>")
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
${Boost_INCLUDE_DIRS}
$<TARGET_PROPERTY:tesseract::tesseract_common,INTERFACE_INCLUDE_DIRECTORIES>) #tesseract::tesseract_common Due to bug in catkin, there is an open PR
${EIGEN3_INCLUDE_DIRS})

configure_package(NAMESPACE tesseract TARGETS ${PROJECT_NAME})

Expand Down
1 change: 1 addition & 0 deletions tesseract/tesseract/cmake/tesseract-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(${CMAKE_VERSION} VERSION_LESS "3.10.0")
else()
find_dependency(Boost COMPONENTS system)
endif()
find_dependency(Eigen3)
find_dependency(tesseract_scene_graph)
find_dependency(tesseract_collision)
find_dependency(tesseract_environment)
Expand Down
4 changes: 3 additions & 1 deletion tesseract/tesseract/include/tesseract/manipulator_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <memory>
#include <Eigen/Geometry>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_scene_graph/srdf_model.h>
#include <tesseract_scene_graph/srdf/types.h>
#include <tesseract_environment/core/environment.h>
#include <tesseract_kinematics/core/forward_kinematics_factory.h>
#include <tesseract_kinematics/core/inverse_kinematics_factory.h>
#include <tesseract/visibility_control.h>

namespace tesseract
{
class ManipulatorManager
class TESSERACT_PUBLIC ManipulatorManager
{
public:
using Ptr = std::shared_ptr<ManipulatorManager>;
Expand Down
3 changes: 2 additions & 1 deletion tesseract/tesseract/include/tesseract/tesseract.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_scene_graph/resource_locator.h>
#include <tesseract/manipulator_manager.h>
#include <tesseract_command_language/manipulator_info.h>
#include <tesseract/visibility_control.h>

namespace tesseract
{
Expand All @@ -59,7 +60,7 @@ using FindTCPCallbackFn = std::function<Eigen::Isometry3d(const tesseract_planni
* It also provides several construction methods for loading from urdf, srdf
*
*/
class Tesseract
class TESSERACT_PUBLIC Tesseract
{
public:
using Ptr = std::shared_ptr<Tesseract>;
Expand Down
3 changes: 2 additions & 1 deletion tesseract/tesseract/include/tesseract/tesseract_init_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
#include <tesseract_scene_graph/resource_locator.h>
#include <tesseract_scene_graph/graph.h>
#include <tesseract_scene_graph/srdf_model.h>
#include <tesseract/visibility_control.h>

namespace tesseract
{
Expand All @@ -56,7 +57,7 @@ enum class TesseractInitType
Note: Recreating a Tesseract does not guarantee that it is identical to the Tesseract associate with this construction
info since the kinmeatics managers could have changed and it does not include the environment command history. This will
simply recreate the Tesseract as it was at construction. */
struct TesseractInitInfo
struct TESSERACT_PUBLIC TesseractInitInfo
{
using Ptr = std::shared_ptr<TesseractInitInfo>;
using ConstPtr = std::shared_ptr<const TesseractInitInfo>;
Expand Down
61 changes: 61 additions & 0 deletions tesseract/tesseract/include/tesseract/visibility_control.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2015 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* This header must be included by all descartes headers which declare symbols
* which are defined in the descartes library. When not building the descartes
* library, i.e. when using the headers in other package's code, the contents
* of this header change the visibility of certain symbols which the descartes
* library cannot have, but the consuming code must have inorder to link.
*/
#ifndef TESSERACT_VISIBILITY_CONTROL_H
#define TESSERACT_VISIBILITY_CONTROL_H

// This logic was borrowed (then namespaced) from the examples on the gcc wiki:
// https://gcc.gnu.org/wiki/Visibility

// clang-format off
#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define TESSERACT_EXPORT __attribute__ ((dllexport))
#define TESSERACT_IMPORT __attribute__ ((dllimport))
#else
#define TESSERACT_EXPORT __declspec(dllexport)
#define TESSERACT_IMPORT __declspec(dllimport)
#endif
#ifndef TESSERACT_STATIC_LIBRARY
#ifdef TESSERACT_LIBRARY_SHARED
#define TESSERACT_PUBLIC TESSERACT_EXPORT
#else
#define TESSERACT_PUBLIC TESSERACT_IMPORT
#endif
#else
#define TESSERACT_PUBLIC
#endif
#define TESSERACT_PUBLIC_TYPE TESSERACT_PUBLIC
#define TESSERACT_LOCAL
#else
#define TESSERACT_EXPORT __attribute__ ((visibility("default")))
#define TESSERACT_IMPORT
#if __GNUC__ >= 4
#define TESSERACT_PUBLIC __attribute__ ((visibility("default")))
#define TESSERACT_LOCAL __attribute__ ((visibility("hidden")))
#else
#define TESSERACT_PUBLIC
#define TESSERACT_LOCAL
#endif
#define TESSERACT_PUBLIC_TYPE
#endif
// clang-format on

#endif // TESSERACT_VISIBILITY_CONTROL_H
2 changes: 2 additions & 0 deletions tesseract/tesseract/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<author>Levi Armstrong</author>

<build_depend>cmake_common_scripts</build_depend>
<build_depend>eigen</build_depend>
<build_export_depend>eigen</build_export_depend>
<depend>boost</depend>
<depend>tesseract_scene_graph</depend>
<depend>tesseract_collision</depend>
Expand Down
16 changes: 13 additions & 3 deletions tesseract/tesseract_collision/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.6.0)
project(tesseract_collision VERSION 0.1.0 LANGUAGES CXX)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

find_package(Eigen3 REQUIRED)
find_package(Boost COMPONENTS system thread program_options REQUIRED)
find_package(octomap REQUIRED)
Expand Down Expand Up @@ -39,8 +42,10 @@ tesseract_variables()

# Create interface for core
add_library(${PROJECT_NAME}_core INTERFACE)
target_process_export(${PROJECT_NAME}_core INTERFACE)
target_link_libraries(${PROJECT_NAME}_core INTERFACE tesseract::tesseract_common tesseract::tesseract_geometry PkgConfig::bullet ${Boost_LIBRARIES})
target_compile_options(${PROJECT_NAME}_core INTERFACE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(${PROJECT_NAME}_core INTERFACE ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(${PROJECT_NAME}_core ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_core INTERFACE VERSION ${TESSERACT_CXX_VERSION})
target_code_coverage(${PROJECT_NAME}_core INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})
Expand All @@ -52,7 +57,7 @@ target_include_directories(${PROJECT_NAME}_core SYSTEM INTERFACE
${Boost_INCLUDE_DIRS})

# Create target for Bullet implementation
add_library(${PROJECT_NAME}_bullet SHARED
add_library(${PROJECT_NAME}_bullet
src/bullet/bullet_cast_bvh_manager.cpp
src/bullet/bullet_cast_simple_manager.cpp
src/bullet/bullet_discrete_bvh_manager.cpp
Expand All @@ -64,8 +69,10 @@ add_library(${PROJECT_NAME}_bullet SHARED
src/bullet/tesseract_convex_convex_algorithm.cpp
src/bullet/tesseract_gjk_pair_detector.cpp
)
target_process_export(${PROJECT_NAME}_bullet)
target_link_libraries(${PROJECT_NAME}_bullet PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_geometry PkgConfig::bullet console_bridge octomap octomath)
target_compile_options(${PROJECT_NAME}_bullet PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(${PROJECT_NAME}_bullet PUBLIC ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(${PROJECT_NAME}_bullet ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_bullet PUBLIC VERSION ${TESSERACT_CXX_VERSION})
target_code_coverage(${PROJECT_NAME}_bullet ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})
Expand All @@ -77,12 +84,14 @@ target_include_directories(${PROJECT_NAME}_bullet SYSTEM PUBLIC
${Boost_INCLUDE_DIRS})

# Create target for FCL implementation
add_library(${PROJECT_NAME}_fcl SHARED
add_library(${PROJECT_NAME}_fcl
src/fcl/fcl_discrete_managers.cpp
src/fcl/fcl_utils.cpp
src/fcl/fcl_collision_object_wrapper.cpp)
target_process_export(${PROJECT_NAME}_fcl)
target_link_libraries(${PROJECT_NAME}_fcl PUBLIC ${PROJECT_NAME}_core tesseract::tesseract_geometry PkgConfig::bullet console_bridge octomap octomath fcl)
target_compile_options(${PROJECT_NAME}_fcl PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(${PROJECT_NAME}_fcl PUBLIC ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(${PROJECT_NAME}_fcl ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_fcl PUBLIC VERSION ${TESSERACT_CXX_VERSION})
target_code_coverage(${PROJECT_NAME}_fcl ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})
Expand All @@ -97,9 +106,9 @@ target_include_directories(${PROJECT_NAME}_fcl SYSTEM PUBLIC
add_executable(create_convex_hull src/create_convex_hull.cpp)
target_link_libraries(create_convex_hull PUBLIC tesseract::tesseract_common tesseract::tesseract_geometry console_bridge PkgConfig::bullet ${Boost_LIBRARIES} octomap octomath)
target_compile_options(create_convex_hull PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(create_convex_hull PRIVATE ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(create_convex_hull ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(create_convex_hull PRIVATE VERSION ${TESSERACT_CXX_VERSION})
target_compile_definitions(create_convex_hull PRIVATE "-DBT_USE_DOUBLE_PRECISION")
target_include_directories(create_convex_hull PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
target_include_directories(create_convex_hull SYSTEM PUBLIC
${EIGEN3_INCLUDE_DIRS}
Expand All @@ -110,6 +119,7 @@ target_include_directories(create_convex_hull SYSTEM PUBLIC
add_library(${PROJECT_NAME}_test_suite INTERFACE)
target_link_libraries(${PROJECT_NAME}_test_suite INTERFACE tesseract::tesseract_support tesseract::tesseract_geometry ${PROJECT_NAME}_core)
target_compile_options(${PROJECT_NAME}_test_suite INTERFACE ${TESSERACT_COMPILE_OPTIONS})
target_compile_definitions(${PROJECT_NAME}_test_suite INTERFACE ${TESSERACT_COMPILE_DEFINITIONS})
target_clang_tidy(${PROJECT_NAME}_test_suite ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_test_suite INTERFACE VERSION ${TESSERACT_CXX_VERSION})
target_code_coverage(${PROJECT_NAME}_test_suite INTERFACE ALL EXCLUDE ${COVERAGE_EXCLUDE} ENABLE ${TESSERACT_ENABLE_TESTING})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@
#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/core/continuous_contact_manager.h>
#include <tesseract_collision/bullet/tesseract_collision_configuration.h>
#include <tesseract_collision/bullet/visibility_control.h>

namespace tesseract_collision
{
namespace tesseract_collision_bullet
{
/** @brief A BVH implementaiton of a tesseract contact manager */
class BulletCastBVHManager : public ContinuousContactManager
class TESSERACT_COLLISION_BULLET_PUBLIC BulletCastBVHManager : public ContinuousContactManager
{
public:
using Ptr = std::shared_ptr<BulletCastBVHManager>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@
#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/core/continuous_contact_manager.h>
#include <tesseract_collision/bullet/tesseract_collision_configuration.h>
#include <tesseract_collision/bullet/visibility_control.h>

namespace tesseract_collision
{
namespace tesseract_collision_bullet
{
/** @brief A simple implementaiton of a tesseract manager which does not use BHV */
class BulletCastSimpleManager : public ContinuousContactManager
class TESSERACT_COLLISION_BULLET_PUBLIC BulletCastSimpleManager : public ContinuousContactManager
{
public:
using Ptr = std::shared_ptr<BulletCastSimpleManager>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@
#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/core/discrete_contact_manager.h>
#include <tesseract_collision/bullet/tesseract_collision_configuration.h>
#include <tesseract_collision/bullet/visibility_control.h>

namespace tesseract_collision
{
namespace tesseract_collision_bullet
{
/** @brief A BVH implementaiton of a bullet manager */
class BulletDiscreteBVHManager : public DiscreteContactManager
class TESSERACT_COLLISION_BULLET_PUBLIC BulletDiscreteBVHManager : public DiscreteContactManager
{
public:
using Ptr = std::shared_ptr<BulletDiscreteBVHManager>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@
#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/core/discrete_contact_manager.h>
#include <tesseract_collision/bullet/tesseract_collision_configuration.h>
#include <tesseract_collision/bullet/visibility_control.h>

namespace tesseract_collision
{
namespace tesseract_collision_bullet
{
/** @brief A simple implementaiton of a bullet manager which does not use BHV */
class BulletDiscreteSimpleManager : public DiscreteContactManager
class TESSERACT_COLLISION_BULLET_PUBLIC BulletDiscreteSimpleManager : public DiscreteContactManager
{
public:
using Ptr = std::shared_ptr<BulletDiscreteSimpleManager>;
Expand Down
Loading

0 comments on commit 596892f

Please sign in to comment.