Skip to content

Commit 5d335a7

Browse files
committed
early exit.
1 parent 53e681d commit 5d335a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmake/FindOpenMPMacOS.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@
33

44
# lint_cmake: -package/consistency
55

6+
function(_is_clang result_out)
7+
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
8+
set(${result_out} TRUE PARENT_SCOPE)
9+
else()
10+
set(${result_out} FALSE PARENT_SCOPE)
11+
endif()
12+
endfunction()
13+
614
macro(find_openmp_macos)
715
if(NOT APPLE)
816
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION}() must only be used on MacOS")
917
endif()
1018

19+
_is_clang(_using_clang)
20+
if(NOT _using_clang)
21+
find_package(OpenMP REQUIRED C CXX)
22+
return()
23+
endif()
24+
1125
if(NOT BUILD_WITH_SHARED_OPENMP)
1226
execute_process(COMMAND brew --prefix libomp
1327
OUTPUT_VARIABLE HOMEBREW_LIBOMP_PREFIX

0 commit comments

Comments
 (0)