--- CMakeLists.txt.orig 2021-08-25 00:31:04 UTC +++ CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_C_STANDARD 99) # Options # # Generic option -option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) +#option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) # Source code set(LLHTTP_SOURCES @@ -23,9 +23,11 @@ set(LLHTTP_HEADERS ) add_library(llhttp) +add_library(llhttp_static STATIC) add_library(llhttp::llhttp ALIAS llhttp) target_sources(llhttp PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS}) +target_sources(llhttp_static PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS}) # On windows with Visual Studio, add a debug postfix so that release # and debug libraries can coexist. @@ -37,13 +39,22 @@ target_include_directories(llhttp PUBLIC $ $ ) +target_include_directories(llhttp_static PUBLIC + $ + $ +) + set_target_properties(llhttp PROPERTIES PUBLIC_HEADER ${LLHTTP_HEADERS}) +set_target_properties(llhttp_static PROPERTIES OUTPUT_NAME llhttp) install(TARGETS llhttp EXPORT llhttp ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/ +) +install(TARGETS llhttp_static + ARCHIVE DESTINATION lib ) # This is required to work with FetchContent