]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libwebsockets/portfile.cmake
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libwebsockets / portfile.cmake
1 vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
2
3 vcpkg_from_github(
4 OUT_SOURCE_PATH SOURCE_PATH
5 REPO warmcat/libwebsockets
6 REF 736f0739ed8c75db0e29c7678b5a9194e957c347 # v4.1.6
7 SHA512 7632439f8cdc87d275a0524b87ea5cd19c3401c1b7bb7fcf673eef3e1ab36c0ec022d2dce050d07bc106af3166575882507a56ac829a4361329311484dc2c5c4
8 HEAD_REF master
9 PATCHES
10 fix-dependency-libuv.patch
11 fix-build-error.patch
12 export-include-path.patch
13 )
14
15 string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LWS_WITH_STATIC)
16 string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LWS_WITH_SHARED)
17
18 ## All LWS options could be possible features:
19 # #
20 # # Major individual features
21 # #
22 # option(LWS_WITH_NETWORK "Compile with network-related code" ON)
23 # option(LWS_ROLE_H1 "Compile with support for http/1 (needed for ws)" ON)
24 # option(LWS_ROLE_WS "Compile with support for websockets" ON)
25 # option(LWS_ROLE_DBUS "Compile with support for DBUS" OFF)
26 # option(LWS_ROLE_RAW_PROXY "Raw packet proxy" OFF)
27 # option(LWS_WITH_HTTP2 "Compile with server support for HTTP/2" ON)
28 # option(LWS_WITH_LWSWS "Libwebsockets Webserver" OFF)
29 # option(LWS_WITH_CGI "Include CGI (spawn process with network-connected stdin/out/err) APIs" OFF)
30 # option(LWS_IPV6 "Compile with support for ipv6" OFF)
31 # option(LWS_UNIX_SOCK "Compile with support for UNIX domain socket" OFF)
32 # option(LWS_WITH_PLUGINS "Support plugins for protocols and extensions" OFF)
33 # option(LWS_WITH_HTTP_PROXY "Support for HTTP proxying" OFF)
34 # option(LWS_WITH_ZIP_FOPS "Support serving pre-zipped files" OFF)
35 # option(LWS_WITH_SOCKS5 "Allow use of SOCKS5 proxy on client connections" OFF)
36 # option(LWS_WITH_GENERIC_SESSIONS "With the Generic Sessions plugin" OFF)
37 # option(LWS_WITH_PEER_LIMITS "Track peers and restrict resources a single peer can allocate" OFF)
38 # option(LWS_WITH_ACCESS_LOG "Support generating Apache-compatible access logs" OFF)
39 # option(LWS_WITH_RANGES "Support http ranges (RFC7233)" OFF)
40 # option(LWS_WITH_SERVER_STATUS "Support json + jscript server monitoring" OFF)
41 # option(LWS_WITH_THREADPOOL "Managed worker thread pool support (relies on pthreads)" OFF)
42 # option(LWS_WITH_HTTP_STREAM_COMPRESSION "Support HTTP stream compression" OFF)
43 # option(LWS_WITH_HTTP_BROTLI "Also offer brotli http stream compression (requires LWS_WITH_HTTP_STREAM_COMPRESSION)" OFF)
44 # option(LWS_WITH_ACME "Enable support for ACME automatic cert acquisition + maintenance (letsencrypt etc)" OFF)
45 # option(LWS_WITH_HUBBUB "Enable libhubbub rewriting support" OFF)
46 # option(LWS_WITH_FTS "Full Text Search support" OFF)
47 # #
48 # # TLS library options... all except mbedTLS are basically OpenSSL variants.
49 # #
50 # option(LWS_WITH_SSL "Include SSL support (defaults to OpenSSL or similar, mbedTLS if LWS_WITH_MBEDTLS is set)" ON)
51 # option(LWS_WITH_MBEDTLS "Use mbedTLS (>=2.0) replacement for OpenSSL. When setting this, you also may need to specify LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS" OFF)
52 # option(LWS_WITH_BORINGSSL "Use BoringSSL replacement for OpenSSL" OFF)
53 # option(LWS_WITH_CYASSL "Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS" OFF)
54 # option(LWS_WITH_WOLFSSL "Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS" OFF)
55 # option(LWS_SSL_CLIENT_USE_OS_CA_CERTS "SSL support should make use of the OS-installed CA root certs" ON)
56 # #
57 # # Event library options (may select multiple, or none for default poll()
58 # #
59 # option(LWS_WITH_LIBEV "Compile with support for libev" OFF)
60 # option(LWS_WITH_LIBUV "Compile with support for libuv" OFF)
61 # option(LWS_WITH_LIBEVENT "Compile with support for libevent" OFF)
62 # #
63 # # Static / Dynamic build options
64 # #
65 # option(LWS_WITH_STATIC "Build the static version of the library" ON)
66 # option(LWS_WITH_SHARED "Build the shared version of the library" ON)
67 # option(LWS_LINK_TESTAPPS_DYNAMIC "Link the test apps to the shared version of the library. Default is to link statically" OFF)
68 # option(LWS_STATIC_PIC "Build the static version of the library with position-independent code" OFF)
69 # #
70 # # Specific platforms
71 # #
72 # option(LWS_WITH_ESP32 "Build for ESP32" OFF)
73 # option(LWS_WITH_ESP32_HELPER "Build ESP32 helper" OFF)
74 # option(LWS_PLAT_OPTEE "Build for OPTEE" OFF)
75 # #
76 # # Client / Server / Test Apps build control
77 # #
78 # option(LWS_WITHOUT_CLIENT "Don't build the client part of the library" OFF)
79 # option(LWS_WITHOUT_SERVER "Don't build the server part of the library" OFF)
80 # option(LWS_WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" OFF)
81 # option(LWS_WITHOUT_TEST_SERVER "Don't build the test server" OFF)
82 # option(LWS_WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version that uses external poll" OFF)
83 # option(LWS_WITHOUT_TEST_PING "Don't build the ping test application" OFF)
84 # option(LWS_WITHOUT_TEST_CLIENT "Don't build the client test application" OFF)
85 # #
86 # # Extensions (permessage-deflate)
87 # #
88 # option(LWS_WITHOUT_EXTENSIONS "Don't compile with extensions" ON)
89 # #
90 # # Helpers + misc
91 # #
92 # option(LWS_WITHOUT_BUILTIN_GETIFADDRS "Don't use the BSD getifaddrs implementation from libwebsockets if it is missing (this will result in a compilation error) ... The default is to assume that your libc provides it. On some systems such as uclibc it doesn't exist." OFF)
93 # option(LWS_FALLBACK_GETHOSTBYNAME "Also try to do dns resolution using gethostbyname if getaddrinfo fails" OFF)
94 # option(LWS_WITHOUT_BUILTIN_SHA1 "Don't build the lws sha-1 (eg, because openssl will provide it" OFF)
95 # option(LWS_WITH_LATENCY "Build latency measuring code into the library" OFF)
96 # option(LWS_WITHOUT_DAEMONIZE "Don't build the daemonization api" ON)
97 # option(LWS_SSL_SERVER_WITH_ECDH_CERT "Include SSL server use ECDH certificate" OFF)
98 # option(LWS_WITH_LEJP "With the Lightweight JSON Parser" ON)
99 # option(LWS_WITH_SQLITE3 "Require SQLITE3 support" OFF)
100 # option(LWS_WITH_STRUCT_JSON "Generic struct serialization to and from JSON" ON)
101 # option(LWS_WITH_STRUCT_SQLITE3 "Generic struct serialization to and from SQLITE3" OFF)
102 # option(LWS_WITH_SMTP "Provide SMTP support" OFF)
103 # if (WIN32 OR LWS_WITH_ESP32)
104 # option(LWS_WITH_DIR "Directory scanning api support" OFF)
105 # option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
106 # else()
107 # option(LWS_WITH_DIR "Directory scanning api support" ON)
108 # option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" ON)
109 # endif()
110 # option(LWS_WITH_NO_LOGS "Disable all logging from being compiled in" OFF)
111 # option(LWS_AVOID_SIGPIPE_IGN "Android 7+ reportedly needs this" OFF)
112 # option(LWS_WITH_STATS "Keep statistics of lws internal operations" OFF)
113 # option(LWS_WITH_JOSE "JSON Web Signature / Encryption / Keys (RFC7515/6/) API" OFF)
114 # option(LWS_WITH_GENCRYPTO "Enable support for Generic Crypto apis independent of TLS backend" OFF)
115 # option(LWS_WITH_SELFTESTS "Selftests run at context creation" OFF)
116 # option(LWS_WITH_GCOV "Build with gcc gcov coverage instrumentation" OFF)
117 # option(LWS_WITH_EXPORT_LWSTARGETS "Export libwebsockets CMake targets. Disable if they conflict with an outer cmake project." ON)
118 # option(LWS_REPRODUCIBLE "Build libwebsockets reproducible. It removes the build user and hostname from the build" ON)
119 # option(LWS_WITH_MINIMAL_EXAMPLES "Also build the normally standalone minimal examples, for QA" OFF)
120 # option(LWS_WITH_LWSAC "lwsac Chunk Allocation api" ON)
121 # option(LWS_WITH_CUSTOM_HEADERS "Store and allow querying custom HTTP headers (H1 only)" ON)
122 # option(LWS_WITH_DISKCACHE "Hashed cache directory with lazy LRU deletion to size limit" OFF)
123 # option(LWS_WITH_ASAN "Build with gcc runtime sanitizer options enabled (needs libasan)" OFF)
124 # option(LWS_WITH_DIR "Directory scanning api support" OFF)
125 # option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
126 # option(LWS_WITH_ZLIB "Include zlib support (required for extensions)" OFF)
127 # option(LWS_WITH_BUNDLED_ZLIB "Use bundled zlib version (Windows only)" ${LWS_WITH_BUNDLED_ZLIB_DEFAULT})
128 # option(LWS_WITH_MINIZ "Use miniz instead of zlib" OFF)
129 # option(LWS_WITH_DEPRECATED_LWS_DLL "Migrate to lws_dll2 instead ASAP" OFF)
130 # option(LWS_WITH_SEQUENCER "lws_seq_t support" ON)
131 # option(LWS_WITH_EXTERNAL_POLL "Support external POLL integration using callback messages (not recommended)" OFF)
132 # option(LWS_WITH_LWS_DSH "Support lws_dsh_t Disordered Shared Heap" OFF)
133 ##
134
135 vcpkg_configure_cmake(
136 SOURCE_PATH ${SOURCE_PATH}
137 PREFER_NINJA
138 OPTIONS
139 -DLWS_WITH_STATIC=${LWS_WITH_STATIC}
140 -DLWS_WITH_SHARED=${LWS_WITH_SHARED}
141 -DLWS_WITH_GENCRYPTO=ON
142 -DLWS_WITH_TLS=ON
143 -DLWS_WITH_BUNDLED_ZLIB=OFF
144 -DLWS_WITHOUT_TESTAPPS=ON
145 -DLWS_IPV6=ON
146 -DLWS_WITH_HTTP2=ON
147 -DLWS_WITH_HTTP_STREAM_COMPRESSION=ON # Since zlib is already a dependency
148 -DLWS_WITH_LIBUV=ON
149 # OPTIONS_RELEASE -DOPTIMIZE=1
150 # OPTIONS_DEBUG -DDEBUGGABLE=1
151 )
152
153 vcpkg_install_cmake()
154
155 if (VCPKG_TARGET_IS_WINDOWS)
156 vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
157 else()
158 vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libwebsockets)
159 endif()
160
161 file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
162 file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
163 file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/libwebsockets-test-server)
164 file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/libwebsockets-config.cmake LIBWEBSOCKETSCONFIG_CMAKE)
165 string(REPLACE "/../include" "/../../include" LIBWEBSOCKETSCONFIG_CMAKE "${LIBWEBSOCKETSCONFIG_CMAKE}")
166 file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/libwebsockets-config.cmake "${LIBWEBSOCKETSCONFIG_CMAKE}")
167 file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debug.cmake LIBWEBSOCKETSTARGETSDEBUG_CMAKE)
168 string(REPLACE "websockets_static.lib" "websockets.lib" LIBWEBSOCKETSTARGETSDEBUG_CMAKE "${LIBWEBSOCKETSTARGETSDEBUG_CMAKE}")
169 file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debug.cmake "${LIBWEBSOCKETSTARGETSDEBUG_CMAKE}")
170 file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-release.cmake LIBWEBSOCKETSTARGETSRELEASE_CMAKE)
171 string(REPLACE "websockets_static.lib" "websockets.lib" LIBWEBSOCKETSTARGETSRELEASE_CMAKE "${LIBWEBSOCKETSTARGETSRELEASE_CMAKE}")
172 file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-release.cmake "${LIBWEBSOCKETSTARGETSRELEASE_CMAKE}")
173 file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
174 if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
175 if (VCPKG_TARGET_IS_WINDOWS)
176 file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/websockets.lib)
177 file(RENAME ${CURRENT_PACKAGES_DIR}/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/lib/websockets.lib)
178 endif()
179 endif ()
180 vcpkg_copy_pdbs()