Skip to content
Snippets Groups Projects
Verified Commit 8b2c85b1 authored by Hendrik's avatar Hendrik Committed by Ralph Giles
Browse files

Add math library (fixes static linking)


Signed-off-by: default avatarRalph Giles <giles@thaumas.net>
Signed-off-by: default avatarevpobr <evpobr@gmail.com>
parent 068e1f4d
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,11 @@ find_package(Opus REQUIRED)
include(CMakePushCheckState)
include(CheckSymbolExists)
cmake_push_check_state(RESET)
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
include(CheckLibraryExists)
check_library_exists(m lrintf "" OP_HAVE_LIBM)
if(OP_HAVE_LIBM)
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
endif()
check_symbol_exists(lrintf "math.h" OP_HAVE_LRINTF)
cmake_pop_check_state()
......@@ -52,6 +56,7 @@ target_link_libraries(opusfile
PUBLIC
Ogg::ogg
Opus::opus
$<$<BOOL:OP_HAVE_LIBM>:m>
)
target_compile_options(opusfile
PRIVATE
......@@ -155,6 +160,7 @@ if(NOT OP_DISABLE_HTTP)
OpenSSL::SSL
$<$<C_COMPILER_ID:MSVC>:ws2_32>
$<$<C_COMPILER_ID:MSVC>:crypt32>
$<$<BOOL:OP_HAVE_LIBM>:m>
)
target_compile_options(opusurl
PRIVATE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment