@@ -20,11 +20,13 @@ void ffOptionsInitLogo(FFOptionsLogo* options) {
2020 options -> recache = false;
2121 options -> position = FF_LOGO_POSITION_LEFT ;
2222
23+ #if FF_HAVE_CHAFA
2324 options -> chafaFgOnly = false;
2425 ffStrbufInitStatic (& options -> chafaSymbols , "block+border+space-wide-inverted" ); // Chafa default
2526 options -> chafaCanvasMode = UINT32_MAX ;
2627 options -> chafaColorSpace = UINT32_MAX ;
2728 options -> chafaDitherMode = UINT32_MAX ;
29+ #endif
2830}
2931
3032bool ffOptionsParseLogoCommandLine (FFOptionsLogo * options , const char * key , const char * value ) {
@@ -160,6 +162,7 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
160162 if (subKey [0 ] == '\0' ) {
161163 ffOptionParseString (key , value , & options -> source );
162164 options -> type = FF_LOGO_TYPE_IMAGE_CHAFA ;
165+ #if FF_HAVE_CHAFA
163166 } else if (ffStrEqualsIgnCase (subKey , "fg-only" )) {
164167 options -> chafaFgOnly = ffOptionParseBoolean (value );
165168 } else if (ffStrEqualsIgnCase (subKey , "symbols" )) {
@@ -189,6 +192,7 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
189192 { "DIFFUSION" , 2 },
190193 {},
191194 });
195+ #endif
192196 } else {
193197 return false;
194198 }
@@ -201,7 +205,9 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
201205
202206void ffOptionsDestroyLogo (FFOptionsLogo * options ) {
203207 ffStrbufDestroy (& options -> source );
208+ #if FF_HAVE_CHAFA
204209 ffStrbufDestroy (& options -> chafaSymbols );
210+ #endif
205211 for (uint8_t i = 0 ; i < (uint8_t ) FASTFETCH_LOGO_MAX_COLORS ; ++ i ) {
206212 ffStrbufDestroy (& options -> colors [i ]);
207213 }
@@ -342,6 +348,7 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo
342348 }
343349 options -> position = (FFLogoPosition ) value ;
344350 continue ;
351+ #if FF_HAVE_CHAFA
345352 } else if (unsafe_yyjson_equals_str (key , "chafa" )) {
346353 if (!yyjson_is_obj (val )) {
347354 return "Chafa config must be an object" ;
@@ -409,6 +416,7 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo
409416 options -> chafaDitherMode = (uint32_t ) value ;
410417 }
411418 continue ;
419+ #endif
412420 } else {
413421 return "Unknown logo key" ;
414422 }
@@ -515,6 +523,7 @@ void ffOptionsGenerateLogoJsonConfig(FFdata* data, FFOptionsLogo* options) {
515523 "right" ,
516524 })[options -> position ]);
517525
526+ #if FF_HAVE_CHAFA
518527 {
519528 yyjson_mut_val * chafa = yyjson_mut_obj (doc );
520529 yyjson_mut_obj_add_bool (doc , chafa , "fgOnly" , options -> chafaFgOnly );
@@ -547,6 +556,7 @@ void ffOptionsGenerateLogoJsonConfig(FFdata* data, FFOptionsLogo* options) {
547556
548557 yyjson_mut_obj_add_val (doc , obj , "chafa" , chafa );
549558 }
559+ #endif
550560
551561 yyjson_mut_obj_add_val (doc , doc -> root , "logo" , obj );
552562}
0 commit comments