From: Steven G. Johnson Date: Thu, 26 Jul 2018 16:58:26 +0000 (-0400) Subject: make sure testopt is linked with C++ linker for nlopt_cxx X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6e7f31fefe4398fafb04a006db4bbf834516d3d1;p=nlopt.git make sure testopt is linked with C++ linker for nlopt_cxx --- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8871312..224ac9c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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)