mirror of https://github.com/microsoft/vcpkg.git
[mongoose] Add embedded filesystem feature (#46244)
This commit is contained in:
parent
b57d06e7d5
commit
2a056cbb57
|
|
@ -5,6 +5,7 @@ project(mongoose C)
|
|||
include(GNUInstallDirs)
|
||||
|
||||
option(ENABLE_SSL "Build with openssl support" OFF)
|
||||
option(ENABLE_PACK "Build pack for embedding read-only filesystems" OFF)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
|
|
@ -12,13 +13,20 @@ add_library(mongoose mongoose.c)
|
|||
target_include_directories(mongoose PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
set_target_properties(mongoose PROPERTIES PUBLIC_HEADER mongoose.h)
|
||||
|
||||
set(INSTALL_TARGETS mongoose)
|
||||
if (ENABLE_PACK)
|
||||
add_executable(pack test/pack.c)
|
||||
list(APPEND INSTALL_TARGETS pack)
|
||||
target_compile_definitions(mongoose PRIVATE MG_ENABLE_PACKED_FS=1)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SSL)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
target_compile_options(mongoose PRIVATE -DMG_ENABLE_SSL)
|
||||
target_link_libraries(mongoose PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
|
||||
install(TARGETS mongoose EXPORT unofficial-mongoose-config)
|
||||
install(TARGETS ${INSTALL_TARGETS} EXPORT unofficial-mongoose-config)
|
||||
|
||||
install(
|
||||
EXPORT unofficial-mongoose-config
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}
|
|||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
ssl ENABLE_SSL
|
||||
pack ENABLE_PACK
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
|
|
@ -24,6 +25,9 @@ vcpkg_cmake_configure(
|
|||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
|
||||
if ("pack" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES pack)
|
||||
endif()
|
||||
|
||||
if("ssl" IN_LIST FEATURES)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
|
||||
|
|
@ -34,6 +38,7 @@ find_dependency(OpenSSL)]])
|
|||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
|
||||
|
||||
# Handle copyright
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "mongoose",
|
||||
"version": "7.18",
|
||||
"port-version": 1,
|
||||
"description": "Embedded web server / embedded networking library",
|
||||
"homepage": "https://cesanta.com/",
|
||||
"license": null,
|
||||
|
|
@ -16,6 +17,9 @@
|
|||
}
|
||||
],
|
||||
"features": {
|
||||
"pack": {
|
||||
"description": "Build pack for embedding read-only filesystems"
|
||||
},
|
||||
"ssl": {
|
||||
"description": "Build with openssl",
|
||||
"dependencies": [
|
||||
|
|
|
|||
|
|
@ -6294,7 +6294,7 @@
|
|||
},
|
||||
"mongoose": {
|
||||
"baseline": "7.18",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"monkeys-audio": {
|
||||
"baseline": "10.08",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "cbd4b16233015998750ba5c6c036f40dcd6d1f7d",
|
||||
"version": "7.18",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "4bdb887b1ae8053655bad57ad914db6370ac219f",
|
||||
"version": "7.18",
|
||||
|
|
|
|||
Loading…
Reference in New Issue