Merge pull request #10806

ee052f7 cmake: add build translations option (tobtoht)

ACKs: selsta, plowsof
This commit is contained in:
tobtoht
2026-06-27 13:04:55 +00:00
3 changed files with 18 additions and 3 deletions
+5 -1
View File
@@ -410,6 +410,7 @@ endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
enable_testing()
option(BUILD_TRANSLATIONS "Build translations using lrelease (Qt)" OFF)
option(BUILD_DOCUMENTATION "Build the Doxygen documentation." ON)
option(BUILD_TESTS "Build tests." OFF)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -632,8 +633,9 @@ function (monero_add_library_with_deps)
PRIVATE $<TARGET_PROPERTY:${MONERO_ADD_LIBRARY_NAME},INTERFACE_COMPILE_DEFINITIONS>)
endfunction ()
if(BUILD_TRANSLATIONS)
# Generate header for embedded translations
# Generate header for embedded translations, use target toolchain if depends, otherwise use the
# use target toolchain if depends, otherwise use the
# lrelease and lupdate binaries from the host
include(ExternalProject)
ExternalProject_Add(generate_translations_header
@@ -643,6 +645,8 @@ ExternalProject_Add(generate_translations_header
CMAKE_ARGS -DLRELEASE_PATH=${LRELEASE_PATH}
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations")
endif()
add_subdirectory(external)
# Final setup for libunbound
+6 -2
View File
@@ -61,8 +61,12 @@ monero_private_headers(common
monero_add_library(common
${common_sources}
${common_headers}
${common_private_headers}
DEPENDS generate_translations_header)
${common_private_headers})
if(BUILD_TRANSLATIONS)
add_dependencies(obj_common generate_translations_header)
endif()
target_link_libraries(common
PUBLIC
cncrypto
+7
View File
@@ -33,7 +33,14 @@
#include <map>
#include "file_io_utils.h"
#include "common/i18n.h"
#if __has_include("translation_files.h")
#include "translation_files.h"
#else
static bool find_embedded_file(const std::string &name, std::string &data) {
return false;
}
#endif
#include <boost/system/error_code.hpp>
#include <boost/filesystem.hpp>