Skip to content

Commit

Permalink
add task
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Dec 27, 2024
1 parent a983a0f commit 43ca67e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ctypesgen/printer_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ def print_library(self, opts):
if opts.embed_templates:
self.file.write(f"\n\n\n{content}")
else:
# we need to share libraries in a common file to build same-library headers separately while loading the library only once
# FIXME reading EXT_LOADER and searching for a string pattern each time is dirty -- a dedicated json status file to track state might be cleaner
loader_txt = self.EXT_LOADER.read_text()
if name_define in loader_txt:
status_message("Library already loaded in shared file, won't rewrite.")
else:
# we need to share libraries in a common file to build same-library headers separately while loading the library only once
status_message("Adding library loader to shared file.")
self.EXT_LOADER.write_text(f"{loader_txt}\n\n{content}\n")

Expand Down

0 comments on commit 43ca67e

Please sign in to comment.