Skip to content

Commit b6312a0

Browse files
committed
Add macOS support
1 parent 68c616d commit b6312a0

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
@@ -52,7 +52,7 @@ See examples for more information about configuring CMake correctly
5252

5353
#else
5454

55-
#ifdef __linux__
55+
#if defined(__linux__) || defined __APPLE__
5656

5757
#define BT_REGISTER_NODES(factory) \
5858
extern "C" void __attribute__((visibility("default"))) \

src/basic_types.cpp

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

127-
const auto old_locale = std::setlocale(LC_NUMERIC,nullptr);
128-
std::setlocale(LC_NUMERIC,"C");
127+
const auto old_locale = setlocale(LC_NUMERIC,nullptr);
128+
setlocale(LC_NUMERIC,"C");
129129
double val = std::stod(str.data());
130-
std::setlocale(LC_NUMERIC,old_locale);
130+
setlocale(LC_NUMERIC,old_locale);
131131
return val;
132132
}
133133

0 commit comments

Comments
 (0)