Description: Fix FTBFS of the "lemonade" CLI target (undefined reference to
 lemon::SystemInfo::get_supported_backends)
 The CLI target compiles src/cpp/server/recipe_options.cpp with -DLEMONADE_CLI
 but does not link src/cpp/server/system_info.cpp. The static helper
 try_get_backend_options() is only called from the non-CLI get_option() code
 path, which is already guarded with #ifndef LEMONADE_CLI, but the helper
 itself was still compiled into the CLI object file and therefore emitted an
 unresolved reference to SystemInfo::get_supported_backends().
 Apply the same #ifndef guard to the helper so that CLI builds no longer
 reference the symbol. No behavior change: the helper is dead code in CLI
 builds (and unchanged in the server build).
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: no
Last-Update: 2026-09-14
--- lemonade-10.2.0.orig/src/cpp/server/recipe_options.cpp
+++ lemonade-10.2.0/src/cpp/server/recipe_options.cpp
@@ -67,6 +67,11 @@ static bool is_empty_option(json option)
            (option.is_string() && (option == "" || option == "auto"));
 }
 
+#ifndef LEMONADE_CLI
+// Only the non-CLI get_option() path below uses this helper. The "lemonade"
+// CLI target compiles this file with -DLEMONADE_CLI but does not link
+// system_info.cpp, so the helper (and its reference to
+// SystemInfo::get_supported_backends) must not be compiled into it.
 static bool try_get_backend_options(const std::string& opt_name, SystemInfo::SupportedBackendsResult& result) {
     // Generic handling for any *_backend option
     // Pattern: {recipe}_backend -> get supported backends for {recipe}
@@ -83,6 +88,7 @@ static bool try_get_backend_options(cons
 
     return is_backend_option;
 }
+#endif // LEMONADE_CLI
 
 std::vector<std::string> RecipeOptions::to_cli_options(const json& raw_options) {
     std::vector<std::string> cli;
