mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
update docs
This commit is contained in:
parent
f9f3827d5d
commit
4997783488
29
README.md
29
README.md
@ -40,16 +40,31 @@ These platforms are officially tested.
|
|||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
|
You have two options to integrate pkpy into your project.
|
||||||
|
|
||||||
|
#### Use the single header file
|
||||||
|
|
||||||
Download the `pocketpy.h` on our [GitHub Release](https://github.com/pocketpy/pocketpy/releases) page.
|
Download the `pocketpy.h` on our [GitHub Release](https://github.com/pocketpy/pocketpy/releases) page.
|
||||||
And `#include` it in your project.
|
And `#include` it in your project. It is recommended to use the latest dev version.
|
||||||
|
|
||||||
You can also use cmake to build it from source. See [CMakeLists.txt](https://github.com/pocketpy/pocketpy/blob/main/CMakeLists.txt) for details.
|
#### Use CMake
|
||||||
Some variables can be set to control the build process:
|
|
||||||
+ `PK_BUILD_STATIC_LIB` - Build the static library (default, recommended)
|
|
||||||
+ `PK_BUILD_SHARED_LIB` - Build the shared (for C-APIs only)
|
|
||||||
+ `PK_ENABLE_OS` - Enable OS related features (default mode is sandboxed)
|
|
||||||
|
|
||||||
It is safe to use `main` branch in production if CI is green.
|
Clone the whole repository as a submodule in your project,
|
||||||
|
In your CMakelists.txt, add the following lines:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
add_subdirectory(pocketpy)
|
||||||
|
target_link_libraries(your_target pocketpy)
|
||||||
|
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
# exceptions must be enabled for emscripten
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fexceptions")
|
||||||
|
endif()
|
||||||
|
```
|
||||||
|
|
||||||
|
See [CMakeLists.txt](https://github.com/pocketpy/pocketpy/blob/main/CMakeLists.txt) for details.
|
||||||
|
|
||||||
|
It is safe to use `main` branch in production if CI badge is green.
|
||||||
|
|
||||||
### Compile Flags
|
### Compile Flags
|
||||||
|
|
||||||
|
@ -14,13 +14,9 @@ And `#include` it in your project. It is recommended to use the latest dev versi
|
|||||||
#### Use CMake
|
#### Use CMake
|
||||||
|
|
||||||
Clone the whole repository as a submodule in your project,
|
Clone the whole repository as a submodule in your project,
|
||||||
You need **Python 3** installed on your system because CMakeLists.txt
|
|
||||||
requires it to generate some files.
|
|
||||||
|
|
||||||
In your CMakelists.txt, add the following lines:
|
In your CMakelists.txt, add the following lines:
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
option(PK_BUILD_STATIC_LIB "Build static library" ON)
|
|
||||||
add_subdirectory(pocketpy)
|
add_subdirectory(pocketpy)
|
||||||
target_link_libraries(your_target pocketpy)
|
target_link_libraries(your_target pocketpy)
|
||||||
|
|
||||||
@ -30,13 +26,9 @@ if(EMSCRIPTEN)
|
|||||||
endif()
|
endif()
|
||||||
```
|
```
|
||||||
|
|
||||||
These variables can be set to control the build process:
|
|
||||||
+ `PK_BUILD_STATIC_LIB` - Build the static library
|
|
||||||
+ `PK_BUILD_SHARED_LIB` - Build the shared library
|
|
||||||
|
|
||||||
See [CMakeLists.txt](https://github.com/pocketpy/pocketpy/blob/main/CMakeLists.txt) for details.
|
See [CMakeLists.txt](https://github.com/pocketpy/pocketpy/blob/main/CMakeLists.txt) for details.
|
||||||
|
|
||||||
It is safe to use `main` branch in production.
|
It is safe to use `main` branch in production if CI badge is green.
|
||||||
|
|
||||||
### Compile flags
|
### Compile flags
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user