Unverified Commit 94b68f34 authored by Nathaniel R. Lewis's avatar Nathaniel R. Lewis Committed by Jean-Marc Valin

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

Signed-off-by: Jean-Marc Valin's avatarJean-Marc Valin <jmvalin@jmvalin.ca>
parent e7806451
......@@ -314,6 +314,11 @@ if(COMPILER_SUPPORT_NEON AND OPUS_USE_NEON)
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}
......
......@@ -16,6 +16,10 @@ if(HAVE_LIBM)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment