shithub: opus

Download patch

ref: 94b68f341cadd5433a10d346c1c248a641d8be57
parent: e780645120a3bf3e04d4eb6c6c06194ed6505429
author: Nathaniel R. Lewis <linux.robotdude@gmail.com>
date: Thu May 9 17:38:14 EDT 2019

cmake - Add support for detecting the presence of lrint and lrintf.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -314,6 +314,11 @@
   endif()
 endif()
 
+target_compile_definitions(opus
+                           PRIVATE
+                           $<$<BOOL:${HAVE_LRINT}>:HAVE_LRINT>
+                           $<$<BOOL:${HAVE_LRINTF}>:HAVE_LRINTF>)
+
 install(TARGETS opus
         EXPORT OpusTargets
         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
--- a/opus_config.cmake
+++ b/opus_config.cmake
@@ -16,6 +16,10 @@
   list(APPEND OPUS_REQUIRED_LIBRARIES m)
 endif()
 
+include(CheckFunctionExists)
+check_function_exists(lrintf HAVE_LRINTF)
+check_function_exists(lrint HAVE_LRINT)
+
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[0-9]86|x86|X86|amd64|AMD64|x86_64)")
   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
     set(OPUS_CPU_X64 1)