mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-05 06:53:06 +00:00
Specific install_name for macOS
This commit is contained in:
parent
c08a774216
commit
4af8b9d60e
2
Makefile
2
Makefile
@ -266,7 +266,7 @@ else ifeq ($(detected_OS),Windows)
|
||||
$(ENV_SCRIPT) nim libcodexDynamic $(NIM_PARAMS) -d:LeopardCmakeFlags="\"-G \\\"MSYS Makefiles\\\" -DCMAKE_BUILD_TYPE=Release\"" codex.nims
|
||||
else ifeq ($(detected_OS),macOS)
|
||||
echo -e $(BUILD_MSG) "build/$@.dylib" && \
|
||||
$(ENV_SCRIPT) nim libcodexDynamic $(NIM_PARAMS) -d:LeopardCmakeFlags="\"-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release\"" codex.nims
|
||||
$(ENV_SCRIPT) nim libcodexDynamic $(NIM_PARAMS) -d:LeopardCmakeFlags="\"-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release\"" --passL:"-install_name @rpath/libs/libcodex.dylib" codex.nims
|
||||
else
|
||||
echo -e $(BUILD_MSG) "build/$@.so" && \
|
||||
$(ENV_SCRIPT) nim libcodexDynamic $(NIM_PARAMS) -d:LeopardCmakeFlags="\"-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release\"" codex.nims
|
||||
|
||||
23
README.md
23
README.md
@ -91,10 +91,6 @@ Run the example:
|
||||
By default, Codex builds a dynamic library (`libcodex.so`), which you can load at runtime.
|
||||
If you prefer a static library (`libcodex.a`), set the `STATIC` flag:
|
||||
|
||||
### Limitation
|
||||
|
||||
Callbacks must be fast and non-blocking; otherwise, the working thread will hang and prevent other requests from being processed.
|
||||
|
||||
```bash
|
||||
# Build dynamic (default)
|
||||
make libcodex
|
||||
@ -103,6 +99,25 @@ make libcodex
|
||||
make STATIC=1 libcodex
|
||||
```
|
||||
|
||||
### Limitation
|
||||
|
||||
Callbacks must be fast and non-blocking; otherwise, the working thread will hang and prevent other requests from being processed.
|
||||
|
||||
### Platform specific
|
||||
|
||||
On macOS, the library is built with `-install_name @rpath/libs/libcodex.dylib` to have the `libs` folder as default
|
||||
path for the artifacts. This can be updates by the application consuming the library using:
|
||||
|
||||
```sh
|
||||
install_name_tool -id @rpath/libcodex.dylib $(CUSTOM_FOLDER)/libcodex.dylib
|
||||
```
|
||||
|
||||
Or when running the executable:
|
||||
|
||||
```sh
|
||||
DYLD_LIBRARY_PATH=$(CUSTOM_FOLDER) ./app
|
||||
```
|
||||
|
||||
## Contributing and development
|
||||
|
||||
Feel free to dive in, contributions are welcomed! Open an issue or submit PRs.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user