Commit Graph

11 Commits

Author SHA1 Message Date
Dery Almas e4dcf1d852 Buildsystem: Simplify format_buffer utility method
This method is used to generate headers for embedding files into the binary
(think about the new `#embed` feature in C23 and C++26).

While the stringification step itself was plenty fast, it then proceeded
to wrap everything using the `textwrap` module. `textwrap` is *very*
slow, as it's apparently optimized for human text.

This patch reimplements the wrapping logic using a simple regex,
resulting in a tremendous speed improvement (~6x), and switches to `map`
for the stringification itself (thanks Rémi!)

It also removes a (practically) unused argument, `initial_indent`.

The generated files are pretty much the same, with a tiny difference in
line length (for some reason the old logic overshot the requested line
length)
2026-04-21 23:18:42 +02:00
David Snopek 2c681794cd GDExtension: Store source of gdextension_interface.h in JSON 2025-11-11 14:58:45 -06:00
Thaddeus Crews be429eb404 SCons: Make builders prettier, utilize constexpr 2025-03-11 18:31:20 -05:00
Thaddeus Crews 96fdaa616b Style: Integrate #pragma once in builders/checks 2025-03-07 17:32:33 -06:00
Thaddeus Crews 5a6e3cbcb0 SCons: Remove run_in_subprocess dependency 2024-03-11 13:20:09 -05:00
Thaddeus Crews fb299d0fb1 SCons: Ensure with statement where applicable 2024-03-10 12:57:57 -05:00
Thaddeus Crews d9fa40f2df Enforce \n eol for Python writes
• Ensure utf-8 encoding if previously unspecified
2024-03-09 14:29:24 -06:00
RedworkDE 110bc5058d Compress embedded GDExtension interface 2023-05-16 22:16:45 +02:00
Haoyu Qiu 49400e0c1c Fix crash when dumping extension API in a non-writable directory 2023-03-08 15:05:44 +08:00
Gilles Roudière be1c9d677d Rename all gdnative occurences to gdextension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension ->Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:04:57 +01:00
Gilles Roudière 55010a2d9f Implement a way to dump the gdnative_interface.h file from the executable 2022-10-13 10:03:30 +02:00