diff --git a/CMakeLists.txt b/CMakeLists.txt index 4136575e43e..97488e11646 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -559,7 +559,7 @@ if(USE_MPI) endif() if(USE_OPENMP) - if(CMAKE_CXX_COMPILER_ID STREQUAL "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.