From 38e4a673947a8188dec18b74092ae42d8b5eccf6 Mon Sep 17 00:00:00 2001 From: Павел Мацула Date: Sat, 19 Sep 2020 16:13:16 +0000 Subject: Fix using FindStandardMathLibrary.cmake with -Wall (-Wunused-value) added to CMAKE_CXX_FLAG --- cmake/FindStandardMathLibrary.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/FindStandardMathLibrary.cmake b/cmake/FindStandardMathLibrary.cmake index 711b0e4b4..fc4728a82 100644 --- a/cmake/FindStandardMathLibrary.cmake +++ b/cmake/FindStandardMathLibrary.cmake @@ -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 -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 -- cgit v1.2.3