Skip to content

Commit

Permalink
make sure testopt is linked with C++ linker for nlopt_cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jul 26, 2018
1 parent 8caf3f6 commit 6e7f31f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ add_custom_target (tests)
add_executable (testopt testfuncs.c testfuncs.h testopt.c
${PROJECT_SOURCE_DIR}/src/util/timer.c ${PROJECT_SOURCE_DIR}/src/util/mt19937ar.c ${PROJECT_SOURCE_DIR}/src/util/nlopt-getopt.c)
target_link_libraries (testopt ${nlopt_lib})
if (NLOPT_CXX)
set_target_properties(testopt PROPERTIES LINKER_LANGUAGE CXX)
endif ()
target_include_directories (testopt PRIVATE ${NLOPT_PRIVATE_INCLUDE_DIRS})
add_dependencies (tests testopt)

Expand Down

0 comments on commit 6e7f31f

Please sign in to comment.