mirror of
https://github.com/aristocratos/btop.git
synced 2026-04-21 10:47:47 +02:00
fix: Guard AppleSilicon GPU code behind __APPLE__ for cross-platform builds
- Wrap AppleSilicon::shutdown() call and declaration with #ifdef __APPLE__ so Linux GPU builds don't get undefined reference errors - Add IOReport library linking in CMakeLists.txt for macOS CMake builds
This commit is contained in:
@@ -208,6 +208,12 @@ if(APPLE)
|
||||
target_link_libraries(libbtop
|
||||
$<LINK_LIBRARY:FRAMEWORK,CoreFoundation> $<LINK_LIBRARY:FRAMEWORK,IOKit>
|
||||
)
|
||||
if(BTOP_GPU)
|
||||
find_library(IOREPORT_LIB IOReport)
|
||||
if(IOREPORT_LIB)
|
||||
target_link_libraries(libbtop ${IOREPORT_LIB})
|
||||
endif()
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
|
||||
# Avoid version mismatch for libstdc++ when a specific version of GCC is installed and not the
|
||||
# default one since all use the default ones RPATH
|
||||
|
||||
@@ -231,7 +231,9 @@ void clean_quit(int sig) {
|
||||
#ifdef GPU_SUPPORT
|
||||
Gpu::Nvml::shutdown();
|
||||
Gpu::Rsmi::shutdown();
|
||||
#ifdef __APPLE__
|
||||
Gpu::AppleSilicon::shutdown();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -183,9 +183,11 @@ namespace Gpu {
|
||||
namespace Rsmi {
|
||||
extern bool shutdown();
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
namespace AppleSilicon {
|
||||
extern bool shutdown();
|
||||
}
|
||||
#endif
|
||||
|
||||
//* Collect gpu stats and temperatures
|
||||
auto collect(bool no_update = false) -> vector<gpu_info>&;
|
||||
|
||||
Reference in New Issue
Block a user