diff options
author | Evan Nemerson <evan@nemerson.com> | 2016-08-04 18:51:20 -0700 |
---|---|---|
committer | Evan Nemerson <evan@nemerson.com> | 2016-08-04 18:51:20 -0700 |
commit | fe0e153cb8273febfa6a6105e6d1598cc3f7069c (patch) | |
tree | 19e2ad39fbccfd224bd0861dcc6239c2d2d84c16 /CMakeLists.txt | |
parent | c1ec7ba29287d3c6a0fb359bbf653aaef66e6581 (diff) | |
download | brotli-fe0e153cb8273febfa6a6105e6d1598cc3f7069c.zip brotli-fe0e153cb8273febfa6a6105e6d1598cc3f7069c.tar.gz brotli-fe0e153cb8273febfa6a6105e6d1598cc3f7069c.tar.bz2 |
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 082b1d8..0cba0f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |