Skip to content
Felix Jones edited this page Oct 1, 2023 · 1 revision

GBFS Archives

add_gbfs_archive(<name> [<source>...])

Creates a GBFS archive target called <name> to bundle source files listed in the command invocation into a GBFS binary file.

Internally, a GBFS archive is an OBJECT library with the properties ASSETS (the list of sources) and GBFS_FILE (the output .gbfs binary file).

The only object in the OBJECT library is a compiled assembly source file of the .gbfs binary file generated with bin2s.

OBJECT libraries can be linked to with target_link_libraries(). For example:

target_link_libraries(A PUBLIC gbfsarchive)

Will link gbfsarchive's compiled object with target A.

The GBFS binary itself may also be referenced with $<TARGET_PROPERTY:gbfsarchive,GBFS_FILE>. For example:

install_rom(A CONCAT ALIGN 256 $<TARGET_PROPERTY:gbfsarchive,GBFS_FILE>)

Will concatenate gbfsarchive's GBFS binary to the end of the GBA executable target A, aligned to the next 256 byte.

The compiled object may also be referenced with an expression in the form $<TARGET_OBJECTS:gbfsarchive>. For example:

add_library(... $<TARGET_OBJECTS:gbfsarchive> ...)
add_executable(... $<TARGET_OBJECTS:gbfsarchive> ...)

Will include gbfsarchive's object file in a library and an executable along with those compiled from their own sources.

Clone this wiki locally