struct

Quartz::Build::SdkOpts

Inherits Struct < Value < Object

Parses the sdk.opts JSON file shipped with every Flipper SDK bundle. This is the source of truth for every compile/link flag — we never hardcode cortex-M4 CFLAGS in Crystal; we read them from here so that SDK version bumps just work.

Path substitutions the SDK uses inside the flag strings: SDK_ROOT_DIR → resolved SDK root (replaced at expand time) SDK_APP_EP_SUBST → app entrypoint symbol name SDK_MAP_FILE_SUBST → path for the linker .map output

Constructors

load(path : String | Path) : SdkOpts

Parse a sdk.opts file from disk.

Source
new(cc_args : Array(String), cpp_args : Array(String), linker_args : Array(String), linker_libs : Array(String), sdk_symbols_rel : String, hardware : String, app_ep_subst : String, sdk_path_subst : String, map_file_subst : String)
Source
parse(raw : String) : SdkOpts

Parse from an in-memory JSON string. Raises Build::Error on malformed input.

Source

Instance methods

app_ep_subst
Source
cc_args
Source
cc_args_for(sdk_root : String | Path) : Array(String)

Return cc_args with SDK_ROOT_DIR replaced by sdk_root. The entrypoint and map-file substitutions only apply to linker_args — we handle those separately in linker_args_for.

Source
cpp_args
Source
cpp_args_for(sdk_root : String | Path) : Array(String)
Source
hardware
Source
linker_args
Source
linker_args_for(sdk_root : String | Path, app_ep : String, map_file : String) : Array(String)

Linker args resolved for a concrete build: app entrypoint symbol and output .map file path are substituted in addition to the SDK root.

Source
linker_libs
Source
map_file_subst
Source
sdk_path_subst
Source
sdk_symbols_path(sdk_root : String | Path) : String

Absolute path to the API symbols CSV for this SDK.

Source
sdk_symbols_rel
Source