2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2017 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2017-04-24 10:49:54 +02:00
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2024-09-20 13:14:57 +10:00
|
|
|
# Build `msgfmt` executable.
|
2017-04-24 10:49:54 +02:00
|
|
|
|
2022-09-18 07:41:13 +02:00
|
|
|
set(INC
|
2017-04-24 10:49:54 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set(SRC
|
2023-07-20 09:49:10 +02:00
|
|
|
msgfmt.cc
|
2017-04-24 10:49:54 +02:00
|
|
|
)
|
|
|
|
|
|
2025-04-04 18:38:53 +02:00
|
|
|
# Manifest required for selecting comctl32 v6 required by the crash popup.
|
|
|
|
|
if(WIN32 AND NOT WITH_WINDOWS_EXTERNAL_MANIFEST)
|
|
|
|
|
LIST(APPEND SRC "${CMAKE_BINARY_DIR}/tests.exe.manifest")
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-09-18 07:41:13 +02:00
|
|
|
set(LIB
|
2023-07-10 22:04:18 +02:00
|
|
|
PRIVATE PRIVATE bf::blenlib
|
2023-07-10 18:44:19 +02:00
|
|
|
PRIVATE bf::intern::guardedalloc
|
2022-09-18 07:41:13 +02:00
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
|
${PLATFORM_LINKLIBS})
|
|
|
|
|
|
2017-04-24 10:49:54 +02:00
|
|
|
add_cc_flags_custom_test(msgfmt)
|
|
|
|
|
|
2020-03-11 10:33:12 -06:00
|
|
|
if(WIN32)
|
2020-11-06 10:29:04 +11:00
|
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:MSVCRT.lib")
|
2022-09-18 07:41:13 +02:00
|
|
|
list(APPEND LIB bf_intern_utfconv)
|
2020-03-11 10:33:12 -06:00
|
|
|
endif()
|
|
|
|
|
|
2017-04-24 10:49:54 +02:00
|
|
|
add_executable(msgfmt ${SRC})
|
2020-09-15 16:00:15 +02:00
|
|
|
setup_platform_linker_flags(msgfmt)
|
2022-09-18 07:41:13 +02:00
|
|
|
blender_target_include_dirs(msgfmt ${INC})
|
|
|
|
|
target_link_libraries(msgfmt ${LIB})
|
2025-04-04 18:38:53 +02:00
|
|
|
|
|
|
|
|
# If using an external manifest, copy it to the output directory after building.
|
|
|
|
|
if(WITH_WINDOWS_EXTERNAL_MANIFEST)
|
|
|
|
|
add_custom_command(TARGET msgfmt POST_BUILD
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/tests.exe.manifest $<TARGET_FILE_DIR:msgfmt>/$<TARGET_FILE_NAME:msgfmt>.manifest
|
|
|
|
|
)
|
|
|
|
|
endif()
|