diff options
author | rtk0c <[email protected]> | 2021-06-11 13:35:35 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-06-11 13:35:35 -0700 |
commit | 8f7daa9bd100345d7e23639604c9a3a50ce6448b (patch) | |
tree | 4b0c4934f29dfca933e1e955a8af2e61c2719ca1 /core/CMakeLists.txt | |
parent | 222cfec6ad882196d8927f73e30d905daae89556 (diff) |
Convert runtime-loaded l10n to string literals chosen at compile time
Diffstat (limited to 'core/CMakeLists.txt')
-rw-r--r-- | core/CMakeLists.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 64a31d7..d3d7496 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -4,6 +4,8 @@ option(BUILD_CORE_WITH_UNITY_BUILD OFF) option(BUILD_CORE_MAIN "Whether to compile the main executable or not." ON) option(BUILD_CORE_TESTS "Whether to compile the tests executable or not." OFF) +set(TARGET_LOCALE "en_US" CACHE STRING "Locale to build.") + option(BUILD_CORE_WITH_OPENGL2_BACKEND ON) option(BUILD_CORE_WITH_OPENGL3_BACKEND ON) option(BUILD_CORE_WITH_VULKAN_BACKEND ON) @@ -70,7 +72,6 @@ add_source_group(MODEL_WORKFLOW_VALUES_MODULE_SOURCES ) set(UI_MODULE_SOURCES - src/UI/Localization.cpp src/UI/UI_DatabaseView.cpp src/UI/UI_Items.cpp src/UI/UI_MainWindow.cpp @@ -81,7 +82,6 @@ set(UI_MODULE_SOURCES ) add_source_group(UTILS_MODULE_SOURCES - src/Utils/I18n.cpp src/Utils/Sigslot.cpp src/Utils/StandardDirectories.cpp src/Utils/Time.cpp @@ -136,6 +136,14 @@ function(add_executable_variant TARGET_NAME) PLATFORM_LINUX=$<BOOL:${LINUX}> ) + if(NOT TARGET_LOCALE STREQUAL "en_US") + target_compile_definitions(${TARGET_NAME} + PRIVATE + TARGET_LOCALE=${TARGET_LOCALE} + TARGET_LOCALE_FILE="Locale/${TARGET_LOCALE}.h" + ) + endif() + if(WIN32) message("CpltCore: - building with DirectX11 backend ${BUILD_CORE_WITH_DX11_BACKEND}") message("CpltCore: - building with DirectX12 backend ${BUILD_CORE_WITH_DX12_BACKEND}") |