update docs

This commit is contained in:
blueloveTH 2024-03-21 16:36:53 +08:00
parent f9f3827d5d
commit 4997783488
2 changed files with 23 additions and 16 deletions

View File

@ -40,16 +40,31 @@ These platforms are officially tested.
## 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.
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.
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)
#### Use CMake
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

View File

@ -14,13 +14,9 @@ And `#include` it in your project. It is recommended to use the latest dev versi
#### Use CMake
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:
```cmake
option(PK_BUILD_STATIC_LIB "Build static library" ON)
add_subdirectory(pocketpy)
target_link_libraries(your_target pocketpy)
@ -30,13 +26,9 @@ if(EMSCRIPTEN)
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.
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