forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: https://hackerone.com/reports/1238099 Refs: https://hackerone.com/reports/1238709 Refs: nodejs-private/llhttp-private#6 Refs: nodejs-private/llhttp-private#5 CVE-ID: CVE-2021-22959 CVE-ID: CVE-2021-22960 PR-URL: nodejs-private/node-private#284 Reviewed-By: Akshay K <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
- Loading branch information
1 parent
842fd23
commit c2e3f85
Showing
5 changed files
with
647 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.