chiark / gitweb /
make sure testopt is linked with C++ linker for nlopt_cxx
authorSteven G. Johnson <stevenj@alum.mit.edu>
Thu, 26 Jul 2018 16:58:26 +0000 (12:58 -0400)
committerSteven G. Johnson <stevenj@alum.mit.edu>
Thu, 26 Jul 2018 16:58:26 +0000 (12:58 -0400)
test/CMakeLists.txt

index 8871312da3016a6c95d911b699f622387461a168..224ac9c145d8c8feaf30b4a3e3c2b76650d58ae6 100644 (file)
@@ -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)