aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-06-24 04:38:30 +0800
committerGitHub <noreply@github.com>2020-06-23 13:38:30 -0700
commit67a031a4d5680b4acb8eeec28ec8c0e7b3dd8102 (patch)
treeef416d3909dcf5f91a1cd082cc398b07cfbb3a37
parent2c280eed4296da5b512987e03c5abb2485e0438f (diff)
downloadvcpkg-67a031a4d5680b4acb8eeec28ec8c0e7b3dd8102.tar.gz
vcpkg-67a031a4d5680b4acb8eeec28ec8c0e7b3dd8102.zip
[libmicrohttpd] Support build on UNIX and use msbuild on Windows (#11983)
* [libmicrohttpd] Support build on UNIX and use msbuild on Windows * update baseline
-rw-r--r--ports/libmicrohttpd/CMakeLists.txt74
-rw-r--r--ports/libmicrohttpd/CONTROL3
-rw-r--r--ports/libmicrohttpd/fix-msvc-project.patch12
-rw-r--r--ports/libmicrohttpd/portfile.cmake56
-rw-r--r--scripts/ci.baseline.txt5
5 files changed, 55 insertions, 95 deletions
diff --git a/ports/libmicrohttpd/CMakeLists.txt b/ports/libmicrohttpd/CMakeLists.txt
deleted file mode 100644
index b54bb7b53..000000000
--- a/ports/libmicrohttpd/CMakeLists.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-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
-)
-
-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()
diff --git a/ports/libmicrohttpd/CONTROL b/ports/libmicrohttpd/CONTROL
index 8636fe183..c78627c7f 100644
--- a/ports/libmicrohttpd/CONTROL
+++ b/ports/libmicrohttpd/CONTROL
@@ -1,4 +1,5 @@
Source: libmicrohttpd
-Version: 0.9.63-2
+Version: 0.9.63-3
Homepage: https://www.gnu.org/software/libmicrohttpd/
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
+Supports: !(arm|uwp) \ No newline at end of file
diff --git a/ports/libmicrohttpd/fix-msvc-project.patch b/ports/libmicrohttpd/fix-msvc-project.patch
new file mode 100644
index 000000000..29071a2be
--- /dev/null
+++ b/ports/libmicrohttpd/fix-msvc-project.patch
@@ -0,0 +1,12 @@
+diff --git a/w32/common/libmicrohttpd-files.vcxproj b/w32/common/libmicrohttpd-files.vcxproj
+index 6f1e03b..c0ddea8 100644
+--- a/w32/common/libmicrohttpd-files.vcxproj
++++ b/w32/common/libmicrohttpd-files.vcxproj
+@@ -3,6 +3,7 @@
+ <ItemGroup>
+ <ClCompile Include="$(MhdSrc)microhttpd\base64.c" />
+ <ClCompile Include="$(MhdSrc)microhttpd\basicauth.c" />
++ <ClCompile Include="$(MhdSrc)microhttpd\sha256.c" />
+ <ClCompile Include="$(MhdSrc)microhttpd\connection.c" />
+ <ClCompile Include="$(MhdSrc)microhttpd\daemon.c" />
+ <ClCompile Include="$(MhdSrc)microhttpd\digestauth.c" />
diff --git a/ports/libmicrohttpd/portfile.cmake b/ports/libmicrohttpd/portfile.cmake
index 52a7f225c..98d0cfab2 100644
--- a/ports/libmicrohttpd/portfile.cmake
+++ b/ports/libmicrohttpd/portfile.cmake
@@ -1,6 +1,6 @@
-set(MICROHTTPD_VERSION 0.9.63)
+vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "arm")
-vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+set(MICROHTTPD_VERSION 0.9.63)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${MICROHTTPD_VERSION}.tar.gz"
@@ -11,18 +11,44 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
OUT_SOURCE_PATH SOURCE_PATH
+ PATCHES fix-msvc-project.patch
)
-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)
+if (VCPKG_TARGET_IS_WINDOWS)
+ if (TRIPLET_SYSTEM_ARCH MATCHES "x86")
+ set(MSBUILD_PLATFORM "Win32")
+ else ()
+ set(MSBUILD_PLATFORM "x64")
+ endif()
+
+ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ set(MICROHTTPD_CONFIGURATION_RELEASE "Release-dll")
+ set(MICROHTTPD_CONFIGURATION_DEBUG "Debug-dll")
+ else()
+ set(MICROHTTPD_CONFIGURATION_RELEASE "Release-static")
+ set(MICROHTTPD_CONFIGURATION_DEBUG "Debug-static")
+ endif()
+
+ vcpkg_install_msbuild(
+ SOURCE_PATH ${SOURCE_PATH}
+ PROJECT_SUBPATH w32/VS2015/libmicrohttpd.vcxproj
+ PLATFORM ${MSBUILD_PLATFORM}
+ RELEASE_CONFIGURATION ${MICROHTTPD_CONFIGURATION_RELEASE}
+ DEBUG_CONFIGURATION ${MICROHTTPD_CONFIGURATION_DEBUG}
+ )
+
+ file(GLOB MICROHTTPD_HEADERS ${SOURCE_PATH}/src/include/*h)
+ foreach(MICROHTTPD_HEADER ${MICROHTTPD_HEADERS})
+ file(COPY ${MICROHTTPD_HEADER} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+ endforeach()
+else()
+ vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ )
+
+ vcpkg_install_make()
+
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+endif()
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index 587823f41..e15f0a6fb 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -808,11 +808,6 @@ libmesh:x64-windows-static=skip
libmesh:x86-windows=skip
libmesh:x64-osx=skip
libmesh:x64-linux=skip
-libmicrohttpd:arm64-windows=fail
-libmicrohttpd:arm-uwp=fail
-libmicrohttpd:x64-linux=fail
-libmicrohttpd:x64-osx=fail
-libmicrohttpd:x64-uwp=fail
libmodbus:arm-uwp=fail
libmodbus:x64-uwp=fail
libmodman:arm-uwp=fail