Skip to content

Commit dd7c7f2

Browse files
authored
Fix error when building static library (#599)
1 parent 208259c commit dd7c7f2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ else()
2626
add_definitions(-Wpedantic)
2727
endif()
2828

29-
#set(CMAKE_POSITION_INDEPENDENT_CODE ON)
30-
3129
#---- project configuration ----
3230
option(BTCPP_SHARED_LIBS "Build shared libraries" ON)
3331
option(BTCPP_BUILD_TOOLS "Build commandline tools" ON)
@@ -154,6 +152,7 @@ if (BTCPP_SHARED_LIBS)
154152
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
155153
add_library(${BTCPP_LIBRARY} SHARED ${BT_SOURCE})
156154
else()
155+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
157156
add_library(${BTCPP_LIBRARY} STATIC ${BT_SOURCE})
158157
endif()
159158

include/behaviortree_cpp/scripting/operators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct ExprBase
3838
virtual Any evaluate(Environment& env) const = 0;
3939
};
4040

41-
std::string ErrorNotInit(const char* side, const char* op_str)
41+
inline std::string ErrorNotInit(const char* side, const char* op_str)
4242
{
4343
return StrCat("The ", side, " operand of the operator [", op_str,
4444
"] is not initialized");

0 commit comments

Comments
 (0)