Fix math library on Visual Studio.

The code was compiled but optimized, and no math function
was used.

Change-Id: Ib2ab262c072761ec41df8f9260a1e0fe57d01cef
This commit is contained in:
Vincent Rabaud 2018-09-11 17:09:12 +02:00
parent d71df4e2ee
commit 6aa3e8aaf3

View File

@ -58,14 +58,15 @@ set(WEBP_HAVE_GL ${OPENGL_FOUND})
# We do not look for it as it is not found when
# cross-compiling, while it is here.
check_c_source_compiles("
#include <cmath>
int main(void) {
return std::pow(2, 2.5);
}
#include <math.h>
int main(int argc, char** argv) {
return pow(argc, 2.5);
}
"
HAVE_MATH_LIBRARY
)
if(NOT HAVE_MATH_LIBRARY)
message(STATUS "Adding -lm flag.")
list(APPEND WEBP_DEP_LIBRARIES m)
endif()