Skip to content

Commit 28267ff

Browse files
committed
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
2 parents 957a7f8 + 4f66447 commit 28267ff

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ else()
7474
include(cmake/conan_build.cmake)
7575
endif()
7676

77-
7877
#############################################################
7978
# LIBRARY
8079

@@ -187,6 +186,7 @@ target_compile_definitions(${BTCPP_LIBRARY} PUBLIC BTCPP_LIBRARY_VERSION="${CMAK
187186
target_compile_features(${BTCPP_LIBRARY} PUBLIC cxx_std_17)
188187

189188
if(MSVC)
189+
target_compile_options(${BTCPP_LIBRARY} PRIVATE "/source-charset:utf-8")
190190
else()
191191
target_compile_options(${BTCPP_LIBRARY} PRIVATE -Wall -Wextra)
192192
endif()

sample_nodes/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,15 @@ target_link_libraries(movebase_node_dyn PRIVATE ${BTCPP_LIBRARY})
3333
target_compile_definitions(movebase_node_dyn PRIVATE BT_PLUGIN_EXPORT )
3434
set_target_properties(movebase_node_dyn PROPERTIES LIBRARY_OUTPUT_DIRECTORY
3535
${BTCPP_BIN_DESTINATION} )
36+
37+
######################################################
38+
# INSTALL plugins for other packages to load
39+
40+
INSTALL(TARGETS
41+
crossdoor_nodes_dyn
42+
dummy_nodes_dyn
43+
movebase_node_dyn
44+
LIBRARY DESTINATION share/${PROJECT_NAME}/bt_plugins
45+
ARCHIVE DESTINATION share/${PROJECT_NAME}/bt_plugins
46+
RUNTIME DESTINATION share/${PROJECT_NAME}/bt_plugins
47+
)

sample_nodes/crossdoor_nodes.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,11 @@ void CrossDoor::reset()
7474
_door_locked = true;
7575
_pick_attempts = 0;
7676
}
77+
78+
// This function must be implemented in the .cpp file to create
79+
// a plugin that can be loaded at run-time
80+
BT_REGISTER_NODES(factory)
81+
{
82+
static CrossDoor cross_door;
83+
cross_door.registerNodes(factory);
84+
}

src/xml_parsing.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
#include <string>
2020
#include <typeindex>
2121

22+
#if defined(_MSVC_LANG) && !defined(__clang__)
23+
#define __bt_cplusplus (_MSC_VER == 1900 ? 201103L : _MSVC_LANG)
24+
#else
25+
#define __bt_cplusplus __cplusplus
26+
#endif
27+
2228
#if defined(__linux) || defined(__linux__)
2329
#pragma GCC diagnostic push
2430
#pragma GCC diagnostic ignored "-Wattributes"
@@ -254,7 +260,12 @@ void XMLParser::PImpl::loadDocImpl(XMLDocument* doc, bool add_includes)
254260
break;
255261
}
256262

257-
std::filesystem::path file_path(incl_node->Attribute("path"));
263+
#if __bt_cplusplus >= 202002L
264+
auto file_path(std::filesystem::path(incl_node->Attribute("path")));
265+
#else
266+
auto file_path(std::filesystem::u8path(incl_node->Attribute("path")));
267+
#endif
268+
258269
const char* ros_pkg_relative_path = incl_node->Attribute("ros_pkg");
259270

260271
if(ros_pkg_relative_path)

0 commit comments

Comments
 (0)