File: properly-check-for-exp10.patch

package info (click to toggle)
edflib 1.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 680 kB
  • sloc: ansic: 9,078; makefile: 68; sh: 12
file content (36 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Fabian Klötzl <fabian@kloetzl.info>
Date: Tue, 22 Aug 2017 10:18:47 +0200
Subject: properly check for exp10
Forwarded: not-needed

---
 CMakeLists.txt    | 10 ++++++++++
 sweep_generator.c |  7 -------
 2 files changed, 10 insertions(+), 7 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,11 @@ set_target_properties(edf
   ${LIBRARY_PROPERTIES}
   )
 
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+set(CMAKE_REQUIRED_LIBRARIES -lm)
+check_symbol_exists(exp10 "math.h" HAVE_EXP10)
+
 install(FILES edflib.h
   DESTINATION include
   )
@@ -44,6 +49,11 @@ target_link_libraries(test_generator edf
 
 add_executable(sweep_generator sweep_generator.c)
 target_link_libraries(sweep_generator edf)
+if(HAVE_EXP10)
+  target_compile_definitions(sweep_generator PRIVATE expo=exp10)
+else()
+  target_compile_definitions(sweep_generator PRIVATE expo=__exp10)
+endif()
 
 if(UNIX)
   target_link_libraries(sine_generator m)