mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 13:38:59 +08:00
Merge pull request #1757 from atkawa7/microhttpd
[libmicrohttpd] init port
This commit is contained in:
commit
ee976fb377
78
ports/libmicrohttpd/CMakeLists.txt
Normal file
78
ports/libmicrohttpd/CMakeLists.txt
Normal file
@ -0,0 +1,78 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(libmicrohttpd C)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
set(MIN_SRC contrib/libmicrohttpd)
|
||||
|
||||
|
||||
set(SRC
|
||||
src/microhttpd/base64.c
|
||||
src/microhttpd/basicauth.c
|
||||
src/microhttpd/connection.c
|
||||
src/microhttpd/daemon.c
|
||||
src/microhttpd/digestauth.c
|
||||
src/microhttpd/internal.c
|
||||
src/microhttpd/md5.c
|
||||
src/microhttpd/memorypool.c
|
||||
src/microhttpd/mhd_mono_clock.c
|
||||
src/microhttpd/postprocessor.c
|
||||
src/microhttpd/reason_phrase.c
|
||||
src/microhttpd/response.c
|
||||
src/microhttpd/tsearch.c
|
||||
src/microhttpd/sysfdsetsize.c
|
||||
src/microhttpd/mhd_str.c
|
||||
src/microhttpd/mhd_threads.c
|
||||
src/microhttpd/mhd_sockets.c
|
||||
src/microhttpd/mhd_itc.c
|
||||
src/microhttpd/mhd_compat.c
|
||||
)
|
||||
set(HEADERS
|
||||
src/microhttpd/base64.h
|
||||
src/microhttpd/connection.h
|
||||
src/microhttpd/internal.h
|
||||
src/microhttpd/md5.h
|
||||
src/microhttpd/memorypool.h
|
||||
src/microhttpd/mhd_byteorder.h
|
||||
src/microhttpd/mhd_limits.h
|
||||
src/microhttpd/mhd_mono_clock.h
|
||||
src/microhttpd/response.h
|
||||
src/microhttpd/tsearch.h
|
||||
src/microhttpd/sysfdsetsize.h
|
||||
src/microhttpd/mhd_str.h
|
||||
src/microhttpd/mhd_threads.h
|
||||
src/microhttpd/mhd_locks.h
|
||||
src/microhttpd/mhd_sockets.h
|
||||
src/microhttpd/mhd_itc.h
|
||||
src/microhttpd/mhd_itc_types.h
|
||||
src/microhttpd/mhd_compat.h
|
||||
)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
include_directories(${HEADERS} src/include w32/common)
|
||||
|
||||
add_library(libmicrohttpd ${SRC})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(libmicrohttpd PRIVATE -DMHD_W32DLL)
|
||||
else()
|
||||
target_compile_definitions(libmicrohttpd PRIVATE -DMHD_W32LIB)
|
||||
endif()
|
||||
|
||||
target_link_libraries(libmicrohttpd ws2_32)
|
||||
|
||||
install(
|
||||
TARGETS libmicrohttpd
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(FILES src/include/microhttpd.h DESTINATION include)
|
||||
endif()
|
3
ports/libmicrohttpd/CONTROL
Normal file
3
ports/libmicrohttpd/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: libmicrohttpd
|
||||
Version: 0.9.55
|
||||
Description: GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application
|
23
ports/libmicrohttpd/portfile.cmake
Normal file
23
ports/libmicrohttpd/portfile.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libmicrohttpd-0.9.55)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.55.tar.gz"
|
||||
FILENAME "libmicrohttpd-0.9.55.tar.gz"
|
||||
SHA512 b410e7253d7c98c40b5e8b8dcd1f93bcbb05c88717190e8dae73073d36465e8e5cfa53c6c5098de60051a5ec64dc423fd94f4b06537d8146b744aa99f5a0b173
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmicrohttpd RENAME copyright)
|
Loading…
Reference in New Issue
Block a user