Skip to content

Commit

Permalink
Update adding_packages.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten authored Jun 24, 2024
1 parent 8ad253f commit 2f13f18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/development/adding_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ The recipe format is described in the [rattler-build recipe format](https://gith
Adding cmake based packages is easy. Usually it is enough to replace the `cmake` command with the `emcmake` command and
`make` with `emmake` (see the [emscripten documentation](https://emscripten.org/docs/compiling/Building-Projects.html#integrating-with-a-build-system) for more details).

To build a shared library with CMake, one needs these additional flags:
To build a shared library with CMake, one needs flags.
These flags can be put into a `.cmake` file:
```CMake
# overwriteProp.cmake
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) # does not need to be global :)
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1")
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1")
set(CMAKE_STRIP FALSE) # used by default in pybind11 on .so modules # only for needed when using pybind11
```

This can be passed to the as command line argument to cmake
```
# CLI
... -DCMAKE_PROJECT_INCLUDE=overwriteProp.cmake
```


**Example recipes**:
Expand Down

0 comments on commit 2f13f18

Please sign in to comment.