]> sigrok.org Git - libsigrok.git/commitdiff
bindings/cxx: support SWIG 4.2 and later
authorKlaus Kämpf <redacted>
Sun, 3 Nov 2024 16:07:29 +0000 (17:07 +0100)
committerSoeren Apel <redacted>
Sun, 9 Nov 2025 21:35:58 +0000 (22:35 +0100)
otherwise building sigrok fails with
bindings/swig/enums.i:1: Error: Unknown directive '%attribute'.

Also indicate that bindings/swig/enums.i is a generated file.

Signed-off-by: Klaus Kämpf <redacted>
bindings/cxx/enums.py

index 3711334e74f740135a94f58ef70e78e7a8570268..388faf2255de9b123634fee507feec4301db5c47 100644 (file)
@@ -73,9 +73,11 @@ header = open(os.path.join(outdirname, 'cxx/include/libsigrokcxx/enums.hpp'), 'w
 code = open(os.path.join(outdirname, 'cxx/enums.cpp'), 'w')
 swig = open(os.path.join(outdirname, 'swig/enums.i'), 'w')
 
-for file in (header, code):
+for file in (header, code, swig):
     print("/* Generated file - edit enums.py instead! */", file=file)
 
+print('%include "attribute.i"', file=swig)
+
 print("namespace sigrok {", file=header)
 
 # Template for beginning of class declaration and public members.