Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten authored Jun 24, 2024
1 parent 02ea552 commit 8ad253f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/development/adding_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ 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:
```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
```



**Example recipes**:

* [xeus](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/xeus)
Expand Down

0 comments on commit 8ad253f

Please sign in to comment.