mirror of
https://github.com/google/brotli.git
synced 2024-12-27 10:20:17 +00:00
cmake: use a different variable for testing with and without libm
CMake seems to cache the result when using the same variable, at least with some versions, so previously systems requiring libm for log2 may not have worked as expected.
This commit is contained in:
parent
c1ec7ba292
commit
fe0e153cb8
@ -48,17 +48,17 @@ include(CheckFunctionExists)
|
||||
set(LIBM_LIBRARY)
|
||||
CHECK_FUNCTION_EXISTS(log2 LOG2_RES)
|
||||
if(NOT LOG2_RES)
|
||||
unset(LOG2_RES)
|
||||
set(orig_req_libs "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
|
||||
CHECK_FUNCTION_EXISTS(log2 LOG2_RES)
|
||||
if(LOG2_RES)
|
||||
CHECK_FUNCTION_EXISTS(log2 LOG2_LIBM_RES)
|
||||
if(LOG2_LIBM_RES)
|
||||
set(LIBM_LIBRARY "m")
|
||||
else()
|
||||
message(FATAL_ERROR "log2() not found")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${orig_req_libs}")
|
||||
unset(LOG2_LIBM_RES)
|
||||
unset(orig_req_libs)
|
||||
endif()
|
||||
unset(LOG2_RES)
|
||||
|
Loading…
Reference in New Issue
Block a user