CMake Header-Only Target (#46)

Make header only library target. 

Use the CMake INTERFACE target type to include the build settings for
snmalloc in other projects using headers only.

Made warnings setting a macro for reuse.
This commit is contained in:
Matthew Parkinson
2019-05-09 12:32:32 +01:00
committed by GitHub
parent b38c36b40f
commit 1e4eb3dea3
2 changed files with 150 additions and 127 deletions

View File

@@ -82,6 +82,16 @@ These can be added to your cmake command line.
-DUSE_MEASURE=ON // Measure performance with histograms
```
The project can be included in other CMake projects as a header
only library:
```
set(SNMALLOC_ONLY_HEADER_LIBRARY ON)
add_subdirectory([...]/snmalloc EXCLUDE_FROM_ALL)
```
This has a single build target `snmalloc_lib`, which includes
the necessary compiler and linker flags, to use snmalloc as a header-only
library.
# Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a