Skip to content

Commit 960a817

Browse files
committed
GPU (Linux): fix building without features
1 parent 6917f94 commit 960a817

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/detection/gpu/gpu_linux.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,24 @@ FF_MAYBE_UNUSED static const char* drmFindRenderFromCard(const char* drmCardKey,
105105

106106
static const char* drmDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu, const char* drmKey, FFstrbuf* buffer)
107107
{
108+
#if FF_HAVE_DRM
108109
const char* error = drmFindRenderFromCard(drmKey, buffer);
109110
if (error) return error;
110111
if (ffStrbufEqualS(&gpu->driver, "radeon"))
111112
return ffDrmDetectRadeon(options, gpu, buffer->chars);
112113
else
113114
{
114-
#if FF_HAVE_DRM_AMDGPU
115+
#if FF_HAVE_DRM_AMDGPU
115116
return ffDrmDetectAmdgpu(options, gpu, buffer->chars);
116-
#else
117+
#else
117118
FF_UNUSED(options, gpu, drmKey, buffer);
118119
return "Fastfetch is not compiled with libdrm_amdgpu support";
119-
#endif
120+
#endif
120121
}
122+
#else
123+
FF_UNUSED(gpu, drmKey, buffer);
124+
return "Fastfetch is not compiled with drm support";
125+
#endif
121126
}
122127

123128
static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer)

0 commit comments

Comments
 (0)