Fix using FindStandardMathLibrary.cmake with -Wall (-Wunused-value) added to CMAKE_CXX_FLAG

This commit is contained in:
Павел Мацула 2020-09-19 16:13:16 +00:00
parent c4b99f78c7
commit 38e4a67394

View File

@ -17,10 +17,11 @@ include(CheckCXXSourceCompiles)
# a little test program for c++ math functions.
# notice the std:: is required on some platforms such as QNX
# notice the (void) is required if -Wall (-Wunused-value) is added to CMAKE_CXX_FLAG
set(find_standard_math_library_test_program
"#include<cmath>
int main() { std::sin(0.0); std::log(0.0f); }")
int main() { (void)std::sin(0.0); (void)std::log(0.0f); }")
# first try compiling/linking the test program without any linker flags