Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 21e9a4bb214648ffd43c66b535fbf096bfcc9f4f Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 24 Jun 2018 00:04:37 -0700 |
| 4 | Subject: [PATCH] Unittest: Link librt and libm using -l option |
| 5 | |
| 6 | cmake'ry forces full path to .so files when found using |
| 7 | find_package and since we have proper sysrooted toolchain |
| 8 | -lm and -lrt is all we need |
| 9 | |
| 10 | Upstream-Status: Inappropriate [Cross compile specific] |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | unittest/CMakeLists.txt | 10 ++-------- |
| 15 | 1 file changed, 2 insertions(+), 8 deletions(-) |
| 16 | |
| 17 | diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt |
| 18 | index c4cdf229..e1b63caf 100644 |
| 19 | --- a/unittest/CMakeLists.txt |
| 20 | +++ b/unittest/CMakeLists.txt |
| 21 | @@ -57,14 +57,8 @@ elseif (WIN32) |
| 22 | else() |
| 23 | set(CHECK_LIBRARIES "${CHECK_INSTALL_DIR}/lib/libcheck.a") |
| 24 | endif() |
| 25 | -find_package(LibM) |
| 26 | -if (LIBM_FOUND) |
| 27 | - set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM") |
| 28 | -endif() |
| 29 | -find_package(LibRt) |
| 30 | -if (LIBRT_FOUND) |
| 31 | - set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT") |
| 32 | -endif() |
| 33 | +set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm") |
| 34 | +set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt") |
| 35 | |
| 36 | # Build the C unit tests |
| 37 | add_library(shared-c-unit-tests STATIC shared.c) |
| 38 | -- |
| 39 | 2.18.0 |
| 40 | |