mdbx-cmake: корректировка пробы OpenMP.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-10-28 08:55:37 +03:00
parent dc6f29a046
commit 8571eac81b
1 changed files with 6 additions and 4 deletions

View File

@ -368,13 +368,15 @@ else()
set(CMAKE_REQUIRED_FLAGS "-fopenmp -Werror") set(CMAKE_REQUIRED_FLAGS "-fopenmp -Werror")
if(CMAKE_CXX_COMPILER_LOADED) if(CMAKE_CXX_COMPILER_LOADED)
check_cxx_source_compiles("int main(void) { check_cxx_source_compiles("int main(void) {
#pragma omp parallel #pragma omp for
return 0; for(int i = 0, j = 0; i != 42; i = 1 + i * 12345) j += i % 43;
return j;
}" HAVE_OPENMP) }" HAVE_OPENMP)
else() else()
check_c_source_compiles("int main(void) { check_c_source_compiles("int main(void) {
#pragma omp parallel #pragma omp for
return 0; for(int i = 0, j = 0; i != 42; i = 1 + i * 12345) j += i % 43;
return j;
}" HAVE_OPENMP) }" HAVE_OPENMP)
endif() endif()
set(CMAKE_REQUIRED_FLAGS "") set(CMAKE_REQUIRED_FLAGS "")