dl* only needed with BTOP_GPU on Linux

Moving the dl library to a LINUX && BTOP_GPU section so -ldl doesn't
get included for non-Linux or non-GPU builds
This commit is contained in:
Nathan Crapo 2024-01-07 15:11:53 -07:00
parent b904097c6a
commit e5a9728e23

View file

@ -120,11 +120,12 @@ target_include_directories(btop SYSTEM PRIVATE include)
# Enable pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(btop Threads::Threads dl)
target_link_libraries(btop Threads::Threads)
# Enable GPU support
if(LINUX AND BTOP_GPU)
target_compile_definitions(btop PRIVATE GPU_SUPPORT)
target_link_libraries(btop dl)
if(BTOP_RSMI_STATIC)
# ROCm doesn't properly add it's folders to the module path if `CMAKE_MODULE_PATH` is already