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