Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 429b028

Browse files
Merge pull request BehaviorTree#135 from 3wnbr1/master
Add macOS support
2 parents a0721d4 + b6312a0 commit 429b028

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if( ZMQ_FOUND )
3838
message(STATUS "ZeroMQ found.")
3939
add_definitions( -DZMQ_FOUND )
4040
list(APPEND BT_SOURCE src/loggers/bt_zmq_publisher.cpp)
41-
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES zmq)
41+
list(APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${ZMQ_LIBRARIES})
4242
else()
4343
message(WARNING "ZeroMQ NOT found. Skipping the build of [PublisherZMQ] and [bt_recorder].")
4444
endif()
@@ -174,6 +174,10 @@ if (WIN32)
174174
add_library(${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE} )
175175
endif()
176176

177+
if( ZMQ_FOUND )
178+
list(APPEND BUILD_TOOL_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS})
179+
endif()
180+
177181
target_link_libraries(${BEHAVIOR_TREE_LIBRARY} PUBLIC
178182
${BEHAVIOR_TREE_EXTERNAL_LIBRARIES})
179183

@@ -233,5 +237,3 @@ if( BUILD_EXAMPLES )
233237
add_subdirectory(sample_nodes)
234238
add_subdirectory(examples)
235239
endif()
236-
237-

include/behaviortree_cpp_v3/bt_factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ See examples for more information about configuring CMake correctly
104104

105105
#else
106106

107-
#ifdef __linux__
107+
#if defined(__linux__) || defined __APPLE__
108108

109109
#define BT_REGISTER_NODES(factory) \
110110
extern "C" void __attribute__((visibility("default"))) \

src/basic_types.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ double convertFromString<double>(StringView str)
125125
// see issue #120
126126
// http://quick-bench.com/DWaXRWnxtxvwIMvZy2DxVPEKJnE
127127

128-
const auto old_locale = std::setlocale(LC_NUMERIC,nullptr);
129-
std::setlocale(LC_NUMERIC,"C");
128+
const auto old_locale = setlocale(LC_NUMERIC,nullptr);
129+
setlocale(LC_NUMERIC,"C");
130130
double val = std::stod(str.data());
131-
std::setlocale(LC_NUMERIC,old_locale);
131+
setlocale(LC_NUMERIC,old_locale);
132132
return val;
133133
}
134134

0 commit comments

Comments
 (0)