diff --git a/.gitignore b/.gitignore index ff49eed57..e2331392b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ corelib cairo-*.tar /cairo2 +*.dylib +*.so diff --git a/Makefile b/Makefile index da0e37b54..a4fa528e4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: usage build book build-dev build-native coverage check test bench bench-ci doc doc-open install clean install-scarb install-scarb-macos build-alexandria +.PHONY: usage build book build-dev build-native coverage check test bench bench-ci doc doc-open install clean install-scarb install-scarb-macos build-alexandria runtime # # Environment detection. @@ -127,3 +127,12 @@ install-scarb-macos: build-alexandria: cd tests/alexandria; scarb build + +runtime: + cargo b --release -p cairo-native-runtime +ifeq ($(UNAME), Linux) + cp target/release/libcairo_native_runtime.so . +endif +ifeq ($(UNAME), Darwin) + cp target/release/libcairo_native_runtime.dylib . +endif diff --git a/runtime/README.md b/runtime/README.md new file mode 100644 index 000000000..38f1f6d87 --- /dev/null +++ b/runtime/README.md @@ -0,0 +1,14 @@ +## The cairo native runtime + +This runtime is used automatically when using JIT, but when using AOT, the library needs to be shipped and put in a path where it can be found by a linker. + +### Getting the library for use in AOT + +```bash +git clone https://github.com/lambdaclass/cairo_native +cd cairo_native +make runtime +ls libcairo_native_runtime.* + +# copy it where you need it, such as /usr/local/lib where it will be found by the linker +```