Skip to content

Commit

Permalink
Install KLLVM python package (#553)
Browse files Browse the repository at this point in the history
* Rename module to _kllvm

* Install kllvm as a package

* Stand in toml

* Package structure

* README

* Don't build?

* Python evrsion

* Fix ignored build

* Update authors
  • Loading branch information
Baltoli committed Sep 1, 2022
1 parent d2981c8 commit 2125afb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
11 changes: 7 additions & 4 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pybind11_add_module(kllvm-static STATIC NO_EXTRAS
runtime.cpp
)

pybind11_add_module(kllvm SHARED
pybind11_add_module(_kllvm SHARED
ast.cpp
)

target_link_libraries(kllvm PUBLIC
target_link_libraries(_kllvm PUBLIC
AST
Parser
)
Expand All @@ -36,6 +36,9 @@ install(FILES $<TARGET_FILE:kllvm-static>
DESTINATION lib/kllvm
RENAME libkllvm.a)

install(TARGETS kllvm
DESTINATION lib/kllvm
install(DIRECTORY package/
DESTINATION lib/python)

install(TARGETS _kllvm
DESTINATION lib/python/kllvm
LIBRARY)
2 changes: 1 addition & 1 deletion bindings/python/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void bind_ast(py::module_ &m) {
.def_property_readonly("name", &KORECompositeSort::getName);
}

PYBIND11_MODULE(kllvm, m) {
PYBIND11_MODULE(_kllvm, m) {
#ifdef KLLVM_BUILD_RUNTIME
bind_runtime(m);
#endif
Expand Down
Empty file.
1 change: 1 addition & 0 deletions bindings/python/package/kllvm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ._kllvm import *
17 changes: 17 additions & 0 deletions bindings/python/package/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "kllvm"
version = "0.1.0"
description = "Python bindings for the K LLVM backend"
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
]
readme = "README.md"
include = ["kllvm/*"]

[tool.poetry.dependencies]
python = ">=3.8"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 2125afb

Please sign in to comment.