1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: remove CMake option "ENABLE_DOC_WARN_LOCALE" (issue #1985)

This commit is contained in:
Sébastien Helleu
2023-07-31 22:01:34 +02:00
parent 73439d5a50
commit c198e875ce
4 changed files with 44 additions and 72 deletions
+33 -34
View File
@@ -95,40 +95,39 @@ else()
set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}")
endif()
option(ENABLE_NCURSES "Compile the Ncurses interface" ON)
option(ENABLE_HEADLESS "Compile the headless binary" ON)
option(ENABLE_NLS "Enable Native Language Support" ON)
option(ENABLE_LARGEFILE "Enable Large File Support" ON)
option(ENABLE_ALIAS "Enable Alias plugin" ON)
option(ENABLE_BUFLIST "Enable Buflist plugin" ON)
option(ENABLE_CHARSET "Enable Charset plugin" ON)
option(ENABLE_EXEC "Enable Exec plugin" ON)
option(ENABLE_FIFO "Enable FIFO plugin" ON)
option(ENABLE_FSET "Enable Fast Set plugin" ON)
option(ENABLE_IRC "Enable IRC plugin" ON)
option(ENABLE_LOGGER "Enable Logger plugin" ON)
option(ENABLE_RELAY "Enable Relay plugin" ON)
option(ENABLE_SCRIPT "Enable Script plugin (script manager)" ON)
option(ENABLE_SCRIPTS "Enable script plugins (perl, python, …)" ON)
option(ENABLE_PERL "Enable Perl scripting language" ON)
option(ENABLE_PYTHON "Enable Python scripting language" ON)
option(ENABLE_RUBY "Enable Ruby scripting language" ON)
option(ENABLE_LUA "Enable Lua scripting language" ON)
option(ENABLE_TCL "Enable Tcl scripting language" ON)
option(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON)
option(ENABLE_JAVASCRIPT "Enable JavaScript scripting language" OFF)
option(ENABLE_PHP "Enable PHP scripting language" ON)
option(ENABLE_SPELL "Enable Spell checker plugin" ON)
option(ENABLE_ENCHANT "Use Enchant lib in Spell checker plugin" OFF)
option(ENABLE_TRIGGER "Enable Trigger plugin" ON)
option(ENABLE_TYPING "Enable Typing plugin" ON)
option(ENABLE_XFER "Enable Xfer plugin" ON)
option(ENABLE_MAN "Enable build of man page" OFF)
option(ENABLE_DOC "Enable build of documentation" OFF)
option(ENABLE_DOC_INCOMPLETE "Enable incomplete doc" OFF)
option(ENABLE_DOC_WARN_LOCALE "Warning instead of error on missing locale" OFF)
option(ENABLE_TESTS "Enable tests" OFF)
option(ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
option(ENABLE_NCURSES "Compile the Ncurses interface" ON)
option(ENABLE_HEADLESS "Compile the headless binary" ON)
option(ENABLE_NLS "Enable Native Language Support" ON)
option(ENABLE_LARGEFILE "Enable Large File Support" ON)
option(ENABLE_ALIAS "Enable Alias plugin" ON)
option(ENABLE_BUFLIST "Enable Buflist plugin" ON)
option(ENABLE_CHARSET "Enable Charset plugin" ON)
option(ENABLE_EXEC "Enable Exec plugin" ON)
option(ENABLE_FIFO "Enable FIFO plugin" ON)
option(ENABLE_FSET "Enable Fast Set plugin" ON)
option(ENABLE_IRC "Enable IRC plugin" ON)
option(ENABLE_LOGGER "Enable Logger plugin" ON)
option(ENABLE_RELAY "Enable Relay plugin" ON)
option(ENABLE_SCRIPT "Enable Script plugin (script manager)" ON)
option(ENABLE_SCRIPTS "Enable script plugins (perl, python, …)" ON)
option(ENABLE_PERL "Enable Perl scripting language" ON)
option(ENABLE_PYTHON "Enable Python scripting language" ON)
option(ENABLE_RUBY "Enable Ruby scripting language" ON)
option(ENABLE_LUA "Enable Lua scripting language" ON)
option(ENABLE_TCL "Enable Tcl scripting language" ON)
option(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON)
option(ENABLE_JAVASCRIPT "Enable JavaScript scripting language" OFF)
option(ENABLE_PHP "Enable PHP scripting language" ON)
option(ENABLE_SPELL "Enable Spell checker plugin" ON)
option(ENABLE_ENCHANT "Use Enchant lib in Spell checker plugin" OFF)
option(ENABLE_TRIGGER "Enable Trigger plugin" ON)
option(ENABLE_TYPING "Enable Typing plugin" ON)
option(ENABLE_XFER "Enable Xfer plugin" ON)
option(ENABLE_MAN "Enable build of man page" OFF)
option(ENABLE_DOC "Enable build of documentation" OFF)
option(ENABLE_DOC_INCOMPLETE "Enable incomplete doc" OFF)
option(ENABLE_TESTS "Enable tests" OFF)
option(ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
# code coverage
add_library(coverage_config INTERFACE)
+1 -1
View File
@@ -46,7 +46,7 @@ Bug fixes::
Build::
* doc: stop build of docs if a locale is missing, add CMake option "ENABLE_DOC_WARN_LOCALE" (issue #1985)
* doc: display a warning if a locale is missing with fallback to English for auto-generated content (issue #1985)
[[v4.0.2]]
== Version 4.0.2 (2023-07-12)
+1 -1
View File
@@ -180,7 +180,7 @@ if(ENABLE_MAN OR ENABLE_DOC)
)
endforeach()
add_custom_target(doc-autogen ALL
COMMAND "${CMAKE_COMMAND}" -E env "WEECHAT_EXTRA_LIBDIR=${PROJECT_BINARY_DIR}/src" "WEECHAT_DOCGEN_LOCALEDIR=${PROJECT_BINARY_DIR}/po" "WEECHAT_DOCGEN_WARN_LOCALE=${ENABLE_DOC_WARN_LOCALE}" "${CMAKE_BINARY_DIR}/src/gui/curses/headless/weechat-headless" --temp-dir --doc-gen "${CMAKE_CURRENT_BINARY_DIR}/autogen"
COMMAND "${CMAKE_COMMAND}" -E env "WEECHAT_EXTRA_LIBDIR=${PROJECT_BINARY_DIR}/src" "WEECHAT_DOCGEN_LOCALEDIR=${PROJECT_BINARY_DIR}/po" "${CMAKE_BINARY_DIR}/src/gui/curses/headless/weechat-headless" --temp-dir --doc-gen "${CMAKE_CURRENT_BINARY_DIR}/autogen"
DEPENDS
# the headless binary is required
weechat-headless
+9 -36
View File
@@ -1602,7 +1602,7 @@ doc_gen_api_config_priority (const char *path, const char *lang)
int
doc_generate (const char *path)
{
int i, j, rc_doc_gen, rc, num_files, warn_locale;
int i, j, rc_doc_gen, rc, num_files;
char *locales[] = {
"de_DE.UTF-8",
"en_US.UTF-8",
@@ -1662,46 +1662,19 @@ doc_generate (const char *path)
if (localedir && localedir[0])
bindtextdomain (PACKAGE, localedir);
/*
* if warn locale is enabled, any missing locale triggers a warning
* instead of a fatal error
*/
warn_locale = (string_strcasecmp (getenv ("WEECHAT_DOCGEN_WARN_LOCALE"), "on") == 0) ?
1 : 0;
for (i = 0; locales[i]; i++)
{
setenv ("LANGUAGE", locales[i], 1);
if (!setlocale (LC_ALL, locales[i]))
{
if (warn_locale)
{
/* warning on missing locale */
string_fprintf (
stderr,
"doc generator: WARNING: failed to set locale \"%s\", "
"docs will include auto-generated English content\n",
locales[i]);
setlocale (LC_ALL, "C");
}
else
{
/* fatal error on missing locale */
string_fprintf (
stderr,
"doc generator: ERROR: failed to set locale \"%s\", "
"these locales must be installed to build docs:\n",
locales[i]);
for (j = 0; locales[j]; j++)
{
string_fprintf (stderr, " %s\n", locales[j]);
}
string_fprintf (
stderr,
"doc generator: you can turn this error into a warning "
"with the cmake option ENABLE_DOC_WARN_LOCALE\n");
goto end;
}
/* warning on missing locale */
string_fprintf (
stderr,
"doc generator: WARNING: failed to set locale \"%s\", "
"docs will include auto-generated English content\n",
locales[i]);
/* fallback to English */
setlocale (LC_ALL, "C");
}
memcpy (lang, locales[i], 2);
lang[2] = '\0';