From 84f9694f2a3dc48ac44e2d0f30665d804dcd254b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 21 Jul 2023 10:13:19 +0200 Subject: [PATCH 1/2] Allow building with Clang Signed-off-by: Uilian Ries --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50b3cbaaf189..49b84e00a399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -545,7 +545,7 @@ if(USE_MPI) endif() if(USE_OPENMP) - if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang|AppleClang") target_link_libraries(lightgbm_objs PUBLIC OpenMP::OpenMP_CXX) # c_api headers also includes OpenMP headers, thus compiling # lightgbm_capi_objs needs include directory for OpenMP. From f1a2ed1f4c94571effbccf75976ad696278a6cb5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 7 Feb 2024 20:07:50 -0600 Subject: [PATCH 2/2] fix compiler detection --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2c9d6a13e5b..f66fb12d5e10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -571,7 +571,7 @@ if(USE_MPI) endif() if(USE_OPENMP) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang|AppleClang") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_link_libraries(lightgbm_objs PUBLIC OpenMP::OpenMP_CXX) # c_api headers also includes OpenMP headers, thus compiling # lightgbm_capi_objs needs include directory for OpenMP.