-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve build system: --disable-shared support, consistent library naming, conditional examples #808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve build system: --disable-shared support, consistent library naming, conditional examples #808
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,40 @@ | ||
| # Don't modify this file, you should modify config.mk or | ||
| # run ./configure --with-MODULE --enable-FEATURE | ||
|
||
|
|
||
| PREFIX=/usr/local | ||
| INSTALL_INCDIR=$(PREFIX)/include/hv | ||
| INSTALL_LIBDIR=$(PREFIX)/lib | ||
|
|
||
| BUILD_SHARED=yes | ||
| BUILD_STATIC=yes | ||
|
|
||
| # modules | ||
| # include icmp dns ftp smtp | ||
| WITH_PROTOCOL=no | ||
|
|
||
| WITH_EVPP=yes | ||
| WITH_HTTP=yes | ||
| WITH_HTTP_SERVER=yes | ||
| WITH_HTTP_CLIENT=yes | ||
| WITH_MQTT=no | ||
|
|
||
| # features | ||
| # base/hsocket.h: Unix Domain Socket | ||
| ENABLE_UDS=no | ||
| # base/RAII.cpp: Windows MiniDumpWriteDump | ||
| ENABLE_WINDUMP=no | ||
| # http/http_content.h: KeyValue,QueryParams,MultiPart | ||
| USE_MULTIMAP=no | ||
|
|
||
| # dependencies | ||
| # for http/client | ||
| WITH_CURL=no | ||
| # for http2 | ||
| WITH_NGHTTP2=no | ||
| # for SSL/TLS | ||
| WITH_OPENSSL=no | ||
| WITH_GNUTLS=no | ||
| WITH_MBEDTLS=no | ||
|
|
||
| # rudp | ||
| WITH_KCP=no | ||
| CONFIG_DATE=20220224 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows with MSVC, setting
OUTPUT_NAME hvon the static target will cause a naming conflict when bothBUILD_SHAREDandBUILD_STATICare enabled (the default). The shared libraryhvalready produces an import libraryhv.lib, and now the static libraryhv_staticwill also producehv.libin the same output directory, causing one to overwrite the other.A common solution is to also set
ARCHIVE_OUTPUT_NAMEto a different name (e.g.,hv_static) on the static target only whenBUILD_SHAREDis also enabled, or alternatively to use theCMAKE_STATIC_LIBRARY_SUFFIXworkaround. Another approach is to guard this property with a condition likeif(NOT BUILD_SHARED OR NOT WIN32).