diff --git a/src/display-console.cc b/src/display-console.cc index 22243b93..eee111d1 100644 --- a/src/display-console.cc +++ b/src/display-console.cc @@ -43,6 +43,7 @@ namespace { conky::display_output_console console_output("console"); } // namespace +void init_console_output() {} namespace priv {} // namespace priv diff --git a/src/display-file.cc b/src/display-file.cc index 9a437c33..0070bd2f 100644 --- a/src/display-file.cc +++ b/src/display-file.cc @@ -49,6 +49,7 @@ namespace { conky::display_output_file file_output("file"); } // namespace +extern void init_file_output() {} namespace priv {} // namespace priv diff --git a/src/display-http.cc b/src/display-http.cc index 9f7e346a..a7c44f8a 100644 --- a/src/display-http.cc +++ b/src/display-http.cc @@ -47,6 +47,7 @@ conky::disabled_display_output http_output_disabled("http", "BUILD_HTTP"); #endif } // namespace +extern void init_http_output() {} // TODO: cleanup namespace // namespace priv { diff --git a/src/display-ncurses.cc b/src/display-ncurses.cc index b06f9fe5..55f4c1e3 100644 --- a/src/display-ncurses.cc +++ b/src/display-ncurses.cc @@ -52,6 +52,7 @@ conky::disabled_display_output ncurses_output_disabled("ncurses", #endif } // namespace +extern void init_ncurses_output() {} // namespace priv { diff --git a/src/display-output.cc b/src/display-output.cc index 392010ae..a06e5e02 100644 --- a/src/display-output.cc +++ b/src/display-output.cc @@ -50,6 +50,13 @@ display_outputs_t *display_outputs; } // namespace +// HACK: force the linker to link all the objects in with test enabled +extern void init_console_output(); +extern void init_ncurses_output(); +extern void init_file_output(); +extern void init_http_output(); +extern void init_x11_output(); + /* * The selected and active display output. */ @@ -99,6 +106,12 @@ disabled_display_output::disabled_display_output(const std::string &name, } bool initialize_display_outputs() { + init_console_output(); + init_ncurses_output(); + init_file_output(); + init_http_output(); + init_x11_output(); + std::vector outputs; outputs.reserve(display_outputs->size()); diff --git a/src/display-x11.cc b/src/display-x11.cc index 3a6286d9..bde4f105 100644 --- a/src/display-x11.cc +++ b/src/display-x11.cc @@ -193,6 +193,7 @@ conky::disabled_display_output x11_output_disabled("x11", "BUILD_X11"); #endif } // namespace +extern void init_x11_output() {} namespace priv {} // namespace priv