From 8571eac81bff1c08bfe5ff2020951dac5f27cee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Mon, 28 Oct 2024 08:55:37 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-cmake:=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B1=D1=8B=20OpenMP.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/compiler.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index a6c7f618..e05df1a6 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -368,13 +368,15 @@ else() set(CMAKE_REQUIRED_FLAGS "-fopenmp -Werror") if(CMAKE_CXX_COMPILER_LOADED) check_cxx_source_compiles("int main(void) { - #pragma omp parallel - return 0; + #pragma omp for + for(int i = 0, j = 0; i != 42; i = 1 + i * 12345) j += i % 43; + return j; }" HAVE_OPENMP) else() check_c_source_compiles("int main(void) { - #pragma omp parallel - return 0; + #pragma omp for + for(int i = 0, j = 0; i != 42; i = 1 + i * 12345) j += i % 43; + return j; }" HAVE_OPENMP) endif() set(CMAKE_REQUIRED_FLAGS "")