summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenMP.cmake
diff options
context:
space:
mode:
authorChristian Pfeiffer <cpfeiffer@live.de>2017-10-24 14:48:33 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-24 14:55:06 (GMT)
commit15da0ba3a2a9e637f5de69b4ea49c55916a2dedb (patch)
tree62453d68eda0bfb3c2589c4b67dc037179158195 /Modules/FindOpenMP.cmake
parenta91eb5e41f486628910f189bf40403568af013c7 (diff)
downloadCMake-15da0ba3a2a9e637f5de69b4ea49c55916a2dedb.zip
CMake-15da0ba3a2a9e637f5de69b4ea49c55916a2dedb.tar.gz
CMake-15da0ba3a2a9e637f5de69b4ea49c55916a2dedb.tar.bz2
Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type
Explicitly return a value from `main` in our test sources. Fixes: #17391
Diffstat (limited to 'Modules/FindOpenMP.cmake')
-rw-r--r--Modules/FindOpenMP.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 272f4dc..5535b9d 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -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;
}
")