Skip to content

Commit

Permalink
release: 6.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Aug 25, 2021
1 parent 99c1055 commit a4aa7a7
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
53 changes: 53 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_policy(SET CMP0069 NEW)

project(llhttp C)

set(CMAKE_C_STANDARD 99)

#
# Options
#
# Generic option
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)

# Source code
set(LLHTTP_SOURCES
src/llhttp.c
src/http.c
src/api.c
)

set(LLHTTP_HEADERS
include/llhttp.h
)

add_library(llhttp)
add_library(llhttp::llhttp ALIAS llhttp)

target_sources(llhttp PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS})

# On windows with Visual Studio, add a debug postfix so that release
# and debug libraries can coexist.
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
endif()

target_include_directories(llhttp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

set_target_properties(llhttp PROPERTIES PUBLIC_HEADER ${LLHTTP_HEADERS})

install(TARGETS llhttp
EXPORT llhttp
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/
)

# This is required to work with FetchContent
install(EXPORT llhttp
FILE llhttp-config.cmake
NAMESPACE llhttp::
DESTINATION lib/cmake/llhttp)
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ For more information on API usage, please refer to [src/native/api.h](https://gi
* Python: [pallas/pyllhttp][8]
* Ruby: [metabahn/llhttp][9]
### Using with CMake
If you want to use this library in a CMake project you can use the snippet below.
```
FetchContent_Declare(llhttp
URL "https://github.com/nodejs/llhttp/releases/download/v6.0.4/llhttp-release-v6.0.4.tar.gz") # Using version 6.0.4

FetchContent_MakeAvailable(llhttp)

target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME})
```
#### LICENSE
This software is licensed under the MIT License.
Expand Down
2 changes: 1 addition & 1 deletion include/llhttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define LLHTTP_VERSION_MAJOR 6
#define LLHTTP_VERSION_MINOR 0
#define LLHTTP_VERSION_PATCH 4
#define LLHTTP_VERSION_PATCH 5

#ifndef LLHTTP_STRICT_MODE
# define LLHTTP_STRICT_MODE 0
Expand Down

0 comments on commit a4aa7a7

Please sign in to comment.