From 89658b3c5c2493428678622b35004540ae7f8e68 Mon Sep 17 00:00:00 2001 From: Radek Krejci Date: Mon, 8 Feb 2016 11:14:46 +0100 Subject: [PATCH] build BUGFIX add missing math library to link with Relates to #17 --- CMakeLists.txt | 3 +++ src/xpath.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd7bef1d..21206d442 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,9 @@ set(headers add_library(yang SHARED ${libsrc}) set_target_properties(yang PROPERTIES VERSION ${LIBYANG_VERSION} SOVERSION ${LIBYANG_SOVERSION}) +# link math +target_link_libraries(yang m) + # find pthreads set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package(Threads REQUIRED) diff --git a/src/xpath.c b/src/xpath.c index b4997fcb0..49885e059 100644 --- a/src/xpath.c +++ b/src/xpath.c @@ -21,6 +21,9 @@ #define _GNU_SOURCE +/* needed by libmath functions isfinite(), isinf(), isnan(), signbit(), ... */ +#define _ISOC99_SOURCE + #include #include #include