Skip to content

cmake: add targets for generating FFI cdecls#2027

Merged
Frenzie merged 6 commits into
koreader:masterfrom
benoit-pierre:pr/ffi-cdecls_helpers
Jan 29, 2025
Merged

cmake: add targets for generating FFI cdecls#2027
Frenzie merged 6 commits into
koreader:masterfrom
benoit-pierre:pr/ffi-cdecls_helpers

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Jan 28, 2025

Copy link
Copy Markdown
Member

For example, after a MuPDF update: make mupdf-ffi to regenerate ffi/mupdf_h.lua. Or make linux-ffi to regenerate ffi/einkfb_h.lua, ffi/inotify_h.lua, ffi/linux_fb_h.lua, ffi/linux_input_h.lua and ffi/rtc_h.lua.

Alternatively make koptcontext_h.lua to regenerate ffi/koptcontext_h.lua (can't have / in target names…), or make ffi to generate all applicable cdecls for the current TARGET.

Notable exceptions:

  • the more thorny ones: posix_h.lua, pthread_h.lua, and inkview_h.lua
  • mxcfb_sony_h.lua: the declarations in ffi-cdecl/mxcfb_sony_decl.c and ffi-cdecl/include/mxcfb-sony.h don't match with ffi/mxcfb_sony_h.lua? (e.g.: no WAVEFORM_MODE_DU)

This change is Reviewable

Tweak "Automatically generated with…" header to avoid absolute paths
(resulting in differences when the base / build directory is different).
- correctly handle `-o output`
- don't write to / overwrite output if the GCC call failed
Nothing major except merging `ffi/custom_input_h` into `ffi/linux_input_h.lua`.
@Frenzie

Frenzie commented Jan 28, 2025

Copy link
Copy Markdown
Member

Ah yes, the Gtk filechooser. Pity it broke. #631

I don't recall if I added drag & drop before or after, but the filechooser seemed a bit redundant to me by the time it unfortunately broke due to incompatible Gtk changes.

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@benoit-pierre

Copy link
Copy Markdown
Member Author

Ah yes, the Gtk filechooser. Pity it broke. #631

I don't recall if I added drag & drop before or after, but the filechooser seemed a bit redundant to me by the time it unfortunately broke due to incompatible Gtk changes.

I think this days a better alternative would be something like the XDG desktop portal mechanism.

@Frenzie

Frenzie commented Jan 28, 2025

Copy link
Copy Markdown
Member

Probably, yes.

@Frenzie Frenzie merged commit 29344ba into koreader:master Jan 29, 2025
@benoit-pierre benoit-pierre deleted the pr/ffi-cdecls_helpers branch January 29, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants