Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type

Explicitly return a value from `main` in our test sources.

Fixes: #17391
This commit is contained in:
Christian Pfeiffer
2017-10-24 16:48:33 +02:00
committed by Brad King
parent a91eb5e41f
commit 15da0ba3a2
2 changed files with 11 additions and 3 deletions

View File

@@ -49,7 +49,9 @@ be returned with OpenACC_<lang>_FLAGS.
set(OpenACC_C_CXX_TEST_SOURCE
"
int main(){
#ifndef _OPENACC
#ifdef _OPENACC
return 0;
#else
breaks_on_purpose
#endif
}
@@ -58,7 +60,9 @@ int main(){
set(OpenACC_Fortran_TEST_SOURCE
"
program test
#ifndef _OPENACC
#ifdef _OPENACC
return 0;
#else
breaks_on_purpose
#endif
endprogram test
@@ -79,6 +83,7 @@ const char accver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A',
int main()
{
puts(accver_str);
return 0;
}
")
set(OpenACC_Fortran_CHECK_VERSION_SOURCE

View File

@@ -123,7 +123,9 @@ set(OpenMP_C_CXX_TEST_SOURCE
"
#include <omp.h>
int main() {
#ifndef _OPENMP
#ifdef _OPENMP
return 0;
#else
breaks_on_purpose
#endif
}
@@ -248,6 +250,7 @@ const char ompver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M',
int main()
{
puts(ompver_str);
return 0;
}
")