Skip to content

Commit

Permalink
dl* only needed with BTOP_GPU on Linux
Browse files Browse the repository at this point in the history
Moving the dl library to a LINUX && BTOP_GPU section so -ldl doesn't
get included for non-Linux or non-GPU builds
  • Loading branch information
ntc490 committed Jan 7, 2024
1 parent b904097 commit e5a9728
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5a9728

Please sign in to comment.