diff options
author | Cameron Cawley <ccawley2011@gmail.com> | 2021-05-22 01:09:48 +0100 |
---|---|---|
committer | Cosmin Truta <ctruta@gmail.com> | 2022-09-10 22:31:28 +0300 |
commit | 763c77e628e2c78b4c422bb7e26327d28ee54ad4 (patch) | |
tree | 089775415453599d6b8b6d12a7c1b92d41d28594 | |
parent | 840af2eda6359e42be7867dfb53e2b2a011c1226 (diff) | |
download | libpng-763c77e628e2c78b4c422bb7e26327d28ee54ad4.tar.gz |
cmake: Fix compilation on systems without libm
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 941cacb49..527d83693 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ # Revised by Sam Serrels, 2017 # Revised by Vadim Barkov, 2017 # Revised by Vicky Pfau, 2018 -# Revised by Cameron Cawley, 2018 +# Revised by Cameron Cawley, 2018,2021 # Revised by Kyle Bentley, 2018 # Revised by David Callu, 2020 # Revised by Steve Robinson, 2020 @@ -49,6 +49,9 @@ endif() if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN) find_library(M_LIBRARY m) + if(NOT M_LIBRARY) + set(M_LIBRARY "") + endif() else() # libm is not needed and/or not available. set(M_LIBRARY "") |