Skip to content

Commit caed04d

Browse files
committed
release: 8.1.1
1 parent be96a82 commit caed04d

File tree

5 files changed

+1071
-595
lines changed

5 files changed

+1071
-595
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.5.1)
22
cmake_policy(SET CMP0069 NEW)
33

4-
project(llhttp VERSION 8.1.0)
4+
project(llhttp VERSION 8.1.1)
55
include(GNUInstallDirs)
66

77
set(CMAKE_C_STANDARD 99)

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,34 @@ make
345345

346346
### Using with CMake
347347

348-
If you want to use this library in a CMake project you can use the snippet below.
348+
If you want to use this library in a CMake project as a shared library, you can use the snippet below.
349349

350350
```
351351
FetchContent_Declare(llhttp
352-
URL "https://github.com/nodejs/llhttp/archive/refs/tags/v6.0.5.tar.gz") # Using version 6.0.5
352+
URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v8.1.0.tar.gz")
353353
354354
FetchContent_MakeAvailable(llhttp)
355355
356-
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME})
356+
# Link with the llhttp_shared target
357+
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp_shared ${PROJECT_NAME})
357358
```
358359

360+
If you want to use this library in a CMake project as a static library, you can set some cache variables first.
361+
362+
```
363+
FetchContent_Declare(llhttp
364+
URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v8.1.0.tar.gz")
365+
366+
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
367+
set(BUILD_STATIC_LIBS ON CACHE INTERNAL "")
368+
FetchContent_MakeAvailable(llhttp)
369+
370+
# Link with the llhttp_static target
371+
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp_static ${PROJECT_NAME})
372+
```
373+
374+
_Note that using the git repo directly (e.g., via a git repo url and tag) will not work with FetchContent_Declare because [CMakeLists.txt](./CMakeLists.txt) requires string replacements (e.g., `_RELEASE_`) before it will build._
375+
359376
## Building on Windows
360377

361378
### Installation

include/llhttp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define LLHTTP_VERSION_MAJOR 8
55
#define LLHTTP_VERSION_MINOR 1
6-
#define LLHTTP_VERSION_PATCH 0
6+
#define LLHTTP_VERSION_PATCH 1
77

88
#ifndef LLHTTP_STRICT_MODE
99
# define LLHTTP_STRICT_MODE 0

llhttp.gyp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
'variables': {
3+
'llhttp_sources': [
4+
'src/llhttp.c',
5+
'src/api.c',
6+
'src/http.c',
7+
]
8+
},
29
'targets': [
310
{
411
'target_name': 'llhttp',
@@ -7,7 +14,9 @@
714
'direct_dependent_settings': {
815
'include_dirs': [ 'include' ],
916
},
10-
'sources': [ 'src/llhttp.c', 'src/api.c', 'src/http.c' ],
17+
'sources': [
18+
'<@(llhttp_sources)',
19+
],
1120
},
1221
]
1322
}

0 commit comments

Comments
 (0)