diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-15 14:48:09 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-15 14:48:09 -0800 |
| commit | 573e08a643bac0af91df90582638f1f765dab429 (patch) | |
| tree | ad745bb81608147304b1bb92aeb682353feedcbd /tests | |
| parent | 694ad48a9c3b4c3d3a91d323a1601c2c4ebacba9 (diff) | |
| download | nng-573e08a643bac0af91df90582638f1f765dab429.tar.gz nng-573e08a643bac0af91df90582638f1f765dab429.tar.bz2 nng-573e08a643bac0af91df90582638f1f765dab429.zip | |
Compile static *and* shared libraries.
Test code needs to use the static libraries so that they can get access
to the entire set of symbols, including private ones that are not exported.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/CMakeLists.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5f8dc7f9..066865e3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright (c) 2012 Martin Sustrik All rights reserved. # Copyright (c) 2013 GoPivotal, Inc. All rights reserved. # Copyright (c) 2015-2016 Jack R. Dunaway. All rights reserved. -# Copyright 2016 Garrett D'Amore <garrett@damore.org> +# Copyright 2017 Garrett D'Amore <garrett@damore.org> # Copyright 2016 Franklin "Snaipe" Mathieu <franklinmathieu@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -30,11 +30,20 @@ include_directories(AFTER SYSTEM ${PROJECT_SOURCE_DIR}/src) if (NNG_TESTS) + if (THREADS_HAVE_PTHREAD_ARG) + add_definitions (-pthread) + endif() + set (TEST_PORT 12100) macro (add_nng_test NAME TIMEOUT) list (APPEND all_tests ${NAME}) add_executable (${NAME} ${NAME}.c convey.c) - target_link_libraries (${NAME} ${PROJECT_NAME}) + target_link_libraries (${NAME} ${PROJECT_NAME}_static) + target_link_libraries (${NAME} ${NNG_REQUIRED_LIBRARIES}) + if (CMAKE_THREAD_LIBS_INIT) + target_link_libraries (${NAME} "${CMAKE_THREAD_LIBS_INIT}") + endif() + add_test (NAME ${NAME} COMMAND ${NAME} -v ${TEST_PORT}) set_tests_properties (${NAME} PROPERTIES TIMEOUT ${TIMEOUT}) math (EXPR TEST_PORT "${TEST_PORT}+10") @@ -42,7 +51,11 @@ if (NNG_TESTS) macro (add_nng_perf NAME) add_executable (${NAME} perf/${NAME}.c) - target_link_libraries (${NAME} ${PROJECT_NAME}) + target_link_libraries (${NAME} ${PROJECT_NAME}_static) + target_link_libraries (${NAME} ${NNG_REQUIRED_LIBRARIES}) + if (CMAKE_THREAD_LIBS_INIT) + target_link_libraries (${NAME} "${CMAKE_THREAD_LIBS_INIT}") + endif() endmacro (add_nng_perf) else () |
