support to build both static and shared libraries

This commit is contained in:
dota17
2020-05-06 10:48:53 +08:00
parent 8e3d3d5544
commit 952db0f397
2 changed files with 29 additions and 1 deletions

View File

@@ -98,6 +98,7 @@ Variable | Type | Description
CMAKE_INSTALL_PREFIX | String | The install location.
CMAKE_BUILD_TYPE | String | Defaults to "debug"
BUILD_SHARED_LIBS | Bool | The default build generates a dynamic (dll/so) library. Set this to OFF to create a static library instead.
BUILD_STATIC_LIBS | Bool | This build generates a static (lib/a) library.
ENABLE_RDRAND | Bool | Enable RDRAND Hardware RNG Hash Seed
ENABLE_THREADING | Bool | Enable partial threading support
DISABLE_WERROR | Bool | Disable use of -Werror
@@ -106,7 +107,14 @@ DISABLE_BSYMBOLIC | Bool | Disable use of -Bsymbolic-functions
Pass these options as `-D` on CMake's command-line.
```sh
cmake -DBUILD_SHARED_LIBS=OFF ...
# build a static library
cmake -DBUILD_SHARED_LIBS=OFF ..
```
Allow to build both static and shared libraries.
```sh
cmake -DBUILD_STATIC_LIBS=ON ..
```
### Building with partial threading support