Bug #2036 make sure find_standard_math_library_test_program actually compiles (and is guaranteed to call math functions)

(cherry picked from commit ecb7bc9514b12051d050299234b2a74ac76b5a8e)
This commit is contained in:
Christoph Hertzberg 2020-10-24 15:22:21 +02:00 committed by David Tellenbach
parent 5dda502f84
commit 3620371c5c

View File

@ -19,8 +19,11 @@ include(CheckCXXSourceCompiles)
# notice the std:: is required on some platforms such as QNX
set(find_standard_math_library_test_program
"#include<cmath>
int main() { std::sin(0.0); std::log(0.0f); }")
"
#include<cmath>
int main(int argc, char **){
return int(std::sin(double(argc)) + std::log(double(argc)));
}")
# first try compiling/linking the test program without any linker flags