Skip to content

Commit 383147e

Browse files
facontidavideclaude
andcommitted
Remove BTCPP_API export macros — redundant with CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
The selective BTCPP_API approach only covered a few classes while the library exports many more free functions and class members. Since CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS already handles all symbol exports, the partial BTCPP_API annotations were dead code. Remove export.h and all BTCPP_API annotations to keep the diff minimal. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8a59850 commit 383147e

9 files changed

Lines changed: 14 additions & 69 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ endif()
218218
if (BTCPP_SHARED_LIBS)
219219
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
220220
add_library(${BTCPP_LIBRARY} SHARED ${BT_SOURCE})
221-
target_compile_definitions(${BTCPP_LIBRARY}
222-
PUBLIC BTCPP_SHARED_LIBS
223-
PRIVATE behaviortree_cpp_EXPORTS
224-
)
225221
else()
226222
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
227223
add_library(${BTCPP_LIBRARY} STATIC ${BT_SOURCE})

include/behaviortree_cpp/action_node.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "leaf_node.h"
1818

19-
#include "behaviortree_cpp/export.h"
20-
2119
#include <atomic>
2220
#include <future>
2321
#include <mutex>
@@ -33,7 +31,7 @@ namespace BT
3331
* A particular derived class is free to override executeTick() as needed.
3432
*
3533
*/
36-
class BTCPP_API ActionNodeBase : public LeafNode
34+
class ActionNodeBase : public LeafNode
3735
{
3836
public:
3937
ActionNodeBase(const std::string& name, const NodeConfig& config);
@@ -55,7 +53,7 @@ class BTCPP_API ActionNodeBase : public LeafNode
5553
* explicitly prevents the status RUNNING and doesn't require
5654
* an implementation of halt().
5755
*/
58-
class BTCPP_API SyncActionNode : public ActionNodeBase
56+
class SyncActionNode : public ActionNodeBase
5957
{
6058
public:
6159
SyncActionNode(const std::string& name, const NodeConfig& config);
@@ -87,7 +85,7 @@ class BTCPP_API SyncActionNode : public ActionNodeBase
8785
* Using lambdas or std::bind it is easy to pass a pointer to a method.
8886
* SimpleActionNode is executed synchronously and does not support halting.
8987
*/
90-
class BTCPP_API SimpleActionNode : public SyncActionNode
88+
class SimpleActionNode : public SyncActionNode
9189
{
9290
public:
9391
using TickFunctor = std::function<NodeStatus(TreeNode&)>;
@@ -129,7 +127,7 @@ class BTCPP_API SimpleActionNode : public SyncActionNode
129127
* a TreeNode::emitWakeUpSignal() will be called.
130128
*/
131129

132-
class BTCPP_API ThreadedAction : public ActionNodeBase
130+
class ThreadedAction : public ActionNodeBase
133131
{
134132
public:
135133
ThreadedAction(const std::string& name, const NodeConfig& config)
@@ -172,7 +170,7 @@ using AsyncActionNode = ThreadedAction;
172170
*
173171
* -) if halted, method onHalted() is invoked
174172
*/
175-
class BTCPP_API StatefulActionNode : public ActionNodeBase
173+
class StatefulActionNode : public ActionNodeBase
176174
{
177175
public:
178176
StatefulActionNode(const std::string& name, const NodeConfig& config)
@@ -209,7 +207,7 @@ class BTCPP_API StatefulActionNode : public ActionNodeBase
209207
* It is up to the user to decide when to suspend execution of the Action and resume
210208
* the parent node, invoking the method setStatusRunningAndYield().
211209
*/
212-
class BTCPP_API CoroActionNode : public ActionNodeBase
210+
class CoroActionNode : public ActionNodeBase
213211
{
214212
public:
215213
CoroActionNode(const std::string& name, const NodeConfig& config);

include/behaviortree_cpp/blackboard.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "behaviortree_cpp/basic_types.h"
44
#include "behaviortree_cpp/contrib/json.hpp"
55
#include "behaviortree_cpp/exceptions.h"
6-
#include "behaviortree_cpp/export.h"
76
#include "behaviortree_cpp/utils/locked_reference.hpp"
87
#include "behaviortree_cpp/utils/safe_any.hpp"
98

@@ -30,7 +29,7 @@ struct StampedValue
3029
* @brief The Blackboard is the mechanism used by BehaviorTrees to exchange
3130
* typed data.
3231
*/
33-
class BTCPP_API Blackboard
32+
class Blackboard
3433
{
3534
public:
3635
using Ptr = std::shared_ptr<Blackboard>;

include/behaviortree_cpp/bt_factory.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "behaviortree_cpp/behavior_tree.h"
1818
#include "behaviortree_cpp/contrib/json.hpp"
1919
#include "behaviortree_cpp/contrib/magic_enum.hpp"
20-
#include "behaviortree_cpp/export.h"
2120

2221
#include <filesystem>
2322
#include <functional>
@@ -92,7 +91,7 @@ bool WildcardMatch(const std::string& str, StringView filter);
9291
* @brief Struct used to store a tree.
9392
* If this object goes out of scope, the tree is destroyed.
9493
*/
95-
class BTCPP_API Tree
94+
class Tree
9695
{
9796
public:
9897
// a tree can contain multiple subtree.
@@ -223,7 +222,7 @@ class Parser;
223222
* Some node types are "builtin", whilst other are used defined and need
224223
* to be registered using a unique ID.
225224
*/
226-
class BTCPP_API BehaviorTreeFactory
225+
class BehaviorTreeFactory
227226
{
228227
public:
229228
BehaviorTreeFactory();

include/behaviortree_cpp/condition_node.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "leaf_node.h"
1818

19-
#include "behaviortree_cpp/export.h"
20-
2119
namespace BT
2220
{
2321
/**
@@ -30,7 +28,7 @@ namespace BT
3028
* Conditions are typically used to check the state of the world or
3129
* the system before performing an action (e.g., "IsDoorOpen", "IsBatteryLow").
3230
*/
33-
class BTCPP_API ConditionNode : public LeafNode
31+
class ConditionNode : public LeafNode
3432
{
3533
public:
3634
ConditionNode(const std::string& name, const NodeConfig& config);
@@ -64,7 +62,7 @@ class BTCPP_API ConditionNode : public LeafNode
6462
*
6563
* Using lambdas or std::bind it is easy to pass a pointer to a method.
6664
*/
67-
class BTCPP_API SimpleConditionNode : public ConditionNode
65+
class SimpleConditionNode : public ConditionNode
6866
{
6967
public:
7068
using TickFunctor = std::function<NodeStatus(TreeNode&)>;

include/behaviortree_cpp/control_node.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#pragma once
1515

16-
#include "behaviortree_cpp/export.h"
1716
#include "behaviortree_cpp/tree_node.h"
1817

1918
#include <vector>
@@ -29,7 +28,7 @@ namespace BT
2928
* Each derived class implements specific rules about if, when, and how many
3029
* times children are ticked.
3130
*/
32-
class BTCPP_API ControlNode : public TreeNode
31+
class ControlNode : public TreeNode
3332
{
3433
protected:
3534
std::vector<TreeNode*> children_nodes_;

include/behaviortree_cpp/decorator_node.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef DECORATORNODE_H
22
#define DECORATORNODE_H
33

4-
#include "behaviortree_cpp/export.h"
54
#include "behaviortree_cpp/tree_node.h"
65

76
namespace BT
@@ -16,7 +15,7 @@ namespace BT
1615
* - Add timing constraints (e.g., Timeout, Delay)
1716
* - Conditionally execute the child (e.g., Precondition)
1817
*/
19-
class BTCPP_API DecoratorNode : public TreeNode
18+
class DecoratorNode : public TreeNode
2019
{
2120
protected:
2221
TreeNode* child_node_;

include/behaviortree_cpp/export.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

include/behaviortree_cpp/tree_node.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include "behaviortree_cpp/basic_types.h"
1717
#include "behaviortree_cpp/blackboard.h"
18-
#include "behaviortree_cpp/export.h"
1918
#include "behaviortree_cpp/scripting/script_parser.hpp"
2019
#include "behaviortree_cpp/utils/signal.h"
2120
#include "behaviortree_cpp/utils/strcat.hpp"
@@ -130,7 +129,7 @@ inline constexpr bool hasNodeFullCtor()
130129
}
131130

132131
/// Abstract base class for Behavior Tree Nodes
133-
class BTCPP_API TreeNode
132+
class TreeNode
134133
{
135134
public:
136135
typedef std::shared_ptr<TreeNode> Ptr;

0 commit comments

Comments
 (0)