twn_text: embed default font

This commit is contained in:
veclavtalica
2025-03-07 03:35:35 +03:00
parent b97a155de4
commit 13bc71a28d
4 changed files with 478 additions and 8 deletions

View File

@@ -354,5 +354,21 @@ link_deps(twn_third_parties)
give_options(${TWN_TARGET})
include_deps(${TWN_TARGET})
link_deps(${TWN_TARGET})
target_link_libraries(${TWN_TARGET} PUBLIC twn_third_parties)
target_include_directories(${TWN_TARGET} PRIVATE ${TWN_ROOT_DIR}/src)
target_link_libraries(${TWN_TARGET} PUBLIC
twn_third_parties
${CMAKE_CURRENT_BINARY_DIR}/font.o)
# embed resources
# TODO: think of a portable way to compress/decompress them
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/font.o
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_LINKER} --relocatable --format binary
--output ${CMAKE_CURRENT_BINARY_DIR}/font.o
share/assets/Dernyns256.ttf
DEPENDS share/assets/Dernyns256.ttf
)
add_custom_target(asset-compilation ALL DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/font.o)