Open haxscramper opened 2 years ago
Need to add support for interfacing with C++ package managers, at least with conan. Tried using it in CI builds - absolutely awesome, amounts to several very simple commands and one (not really obvious though) flag passed to the gcc - @$(pwd)/conanbuildinfo.gcc
allows reading list of flags from the conanbuildinfo.gcc
file generated by conan
.
pip install conan
conan install . --build=missing
nimble -y develop
nim c -r \
--passL:"@$(pwd)/conanbuildinfo.gcc" \
--passC:"@$(pwd)/conanbuildinfo.gcc" \
-d:libgit2LinkMode=dlink \
-d:libssh2LinkMode=dlink \
tests/test1.nim
In addition to the API wrapper generation, it is also necessary to properly reuse all the type import maps from the dependencies. For example, libssh2 contains a file with all the types encountered when wrapping this library. When libgit wrapper is generated, it must know a list of dependencies to be able to properly read import maps. In an ideal world, this could've been solved by asking package manager to list the locations of all the dependencies, and then simply searching for the hcparse_type_imports.xml
file in the repositories. Nimble cannot do this at all, but with nimph I can at least try and read the environment in which wrapper generation is performed, and find all target import maps.
Stable documented API for automatically writing wrapper generators scripts using multiple parsing frontends and code expansion logic. Ideally it should not be necessary in large number of cases (for simpler libraries), but something like this libgit wrappers
or this libssh2 wrappers
is necessary. This API can further be expanded on, to automate handling of the conan packages, git and github repositories, automatic tracking of changes (#9) and so on.