Skip to content

Commit

Permalink
solver-factory.hxx: ensure preprocessor definition is treated as string
Browse files Browse the repository at this point in the history
This should work for both roboptim-core and software depending on it.
  • Loading branch information
bchretien committed Jun 1, 2016
1 parent 409dcc6 commit 251dc0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
ENDIF()

IF(PROJECT_DEBUG_POSTFIX)
SET(FLAG_POSTFIX -DROBOPTIM_DEBUG_POSTFIX="${PROJECT_DEBUG_POSTFIX}")
SET(FLAG_POSTFIX -DROBOPTIM_DEBUG_POSTFIX=${PROJECT_DEBUG_POSTFIX})
ADD_COMPILE_OPTIONS($<$<CONFIG:Debug>:${FLAG_POSTFIX}>)
PKG_CONFIG_APPEND_CFLAGS_DEBUG(${FLAG_POSTFIX})
ENDIF()
Expand Down
4 changes: 3 additions & 1 deletion include/roboptim/core/solver-factory.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# include <typeinfo>
# include <stdexcept>

# include <boost/preprocessor/stringize.hpp>

# include <roboptim/core/util.hh>
# include <roboptim/core/portability.hh>

Expand Down Expand Up @@ -62,7 +64,7 @@ namespace roboptim
std::stringstream ss;
ss << "roboptim-core-plugin-" << plugin;
#ifdef ROBOPTIM_DEBUG_POSTFIX
ss << ROBOPTIM_DEBUG_POSTFIX;
ss << BOOST_PP_STRINGIZE(ROBOPTIM_DEBUG_POSTFIX);
#endif
handle_ = lt_dlopenext (ss.str ().c_str ());
if (!handle_)
Expand Down

0 comments on commit 251dc0b

Please sign in to comment.