Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something build in msvc fixed #843

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ else()
include(cmake/conan_build.cmake)
endif()

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

#############################################################
# LIBRARY
Expand Down
15 changes: 14 additions & 1 deletion src/xml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@
#include <string>
#include <typeindex>

#define __bt_cplusplus __cplusplus
#if defined(_MSVC_LANG) && !defined(__clang__)
#define __bt_cplusplus (_MSC_VER == 1900 ? 201103L : _MSVC_LANG)
#endif

#if defined(__linux) || defined(__linux__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
#endif


#include <map>
#include "behaviortree_cpp/xml_parsing.h"
#include "tinyxml2/tinyxml2.h"
Expand All @@ -37,6 +43,8 @@
#include <ament_index_cpp/get_package_share_directory.hpp>
#endif

#include <iso646.h>

#include "behaviortree_cpp/blackboard.h"
#include "behaviortree_cpp/tree_node.h"
#include "behaviortree_cpp/utils/demangle_util.h"
Expand Down Expand Up @@ -254,7 +262,12 @@ void XMLParser::PImpl::loadDocImpl(XMLDocument* doc, bool add_includes)
break;
}

std::filesystem::path file_path(incl_node->Attribute("path"));
#if __bt_cplusplus >= 202002L
auto file_path(incl_node->Attribute("path"));
#else
auto file_path(std::filesystem::u8path(incl_node->Attribute("path")));
#endif

const char* ros_pkg_relative_path = incl_node->Attribute("ros_pkg");

if(ros_pkg_relative_path)
Expand Down
Loading