feat: Initiated pybind11 Configuration #123
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #84 partially
Signed-off-by: Yash Pandey (YP) yash.btech.cs19@iiitranchi.ac.in
Description
This code initiated the configuration of
pybind11
into the project through CMake.build/_deps
directory and makes it available to our targets.pycasbin
which compiles to a dynamic library i.e. a python module which can be imported in Python code.CASBIN_BUILD_BINDINGS
to specify whether to build language bindings, andCASBIN_BUILD_PYTHON_BINDINGS
to toggle builds specific to python bindings.CASBIN_BUILD_BINDINGS
andCASBIN_BUILD_PYTHON_BINDINGS
won't fetch anything from GitHub adding modularity to our build system.makefile
since it is now auto-generated through CMake.Noteworthy
Although the build system works well and needs minimal configuration from the user's standpoint, I encountered many errors related to C++ standard used when trying to link
pycasbin
with thecasbin
target.Vital template definitions like
std::variant
were undefined. This is becuasepycasbin
is built with C++11 standard whilecasbin
is compiled with C++17 standard.I referred (no copy-pasting) to the build system config for pybind11 from AcademySoftwareFoundation/OpenColorIO for this as I think it was suitable for our use case.