diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b6d45c22..e2eb9eef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,15 @@ endif(COVERAGE) include(FindPackageHandleStandardArgs) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") -find_package(Check) +find_package(PkgConfig QUIET) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(CHECK QUIET check>=0.10) +endif() + +if(NOT CHECK_FOUND) + find_package(Check QUIET 0.10) +endif() if (HAVE_ITT_INSTRUMENTATION) if(PKG_CONFIG_FOUND) diff --git a/ci/install-check.sh b/ci/install-check.sh index 95d17c9e0..0658135c4 100755 --- a/ci/install-check.sh +++ b/ci/install-check.sh @@ -17,7 +17,10 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir" cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; } trap cleanup EXIT -TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL' +realpath() { python -c "from __future__ import print_function; import os,sys; print(os.path.realpath(sys.argv[1]))" "$1"; } + +TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL' + CHECK_VERSION=0.12.0 CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 43828ce17..99582e640 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,13 +19,13 @@ set(SOURCE cc_ring_array.c cc_signal.c) -# targets to build: here we have both static and dynmaic libs +# targets to build: here we have both static and dynamic libs set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) add_library(${PROJECT_NAME}-static STATIC ${SOURCE}) add_library(${PROJECT_NAME}-shared SHARED ${SOURCE}) if (OS_PLATFORM STREQUAL "OS_LINUX") - target_link_libraries(${PROJECT_NAME}-static rt) - target_link_libraries(${PROJECT_NAME}-shared rt) + target_link_libraries(${PROJECT_NAME}-static rt m pthread) + target_link_libraries(${PROJECT_NAME}-shared rt m pthread) endif(OS_PLATFORM STREQUAL "OS_LINUX") set_target_properties(${PROJECT_NAME}-static PROPERTIES diff --git a/test/ring_array/check_ring_array.c b/test/ring_array/check_ring_array.c index c4bcc0845..a60a159a6 100644 --- a/test/ring_array/check_ring_array.c +++ b/test/ring_array/check_ring_array.c @@ -207,6 +207,7 @@ START_TEST(test_thread) } } + pthread_join(producer, NULL); ring_array_destroy(&arr); #undef ELEM_SIZE #undef CAP