mirror of
https://github.com/curl/curl.git
synced 2026-07-24 19:47:16 +03:00
cmake: lib CURL_STATICLIB fixes (Windows)
- always define `CURL_STATICLIB` when building libcurl for Windows. This disables `__declspec(dllexport)` for exported libcurl symbols. In normal mode (hide symbols) these exported symbols are specified via `libcurl.def`. When not hiding symbols, all symbols are exported by default. Regression from1199308dbcFixes #11844 - fix to omit `libcurl.def` when not hiding private symbols. Regression from2ebc74c36a- fix `ENABLED_DEBUG=ON` + shared curl tool Windows builds by also omitting `libcurl.def` in this case, and exporting all symbols instead. This ensures that a shared curl tool can access all debug functions which are not normally exported from libcurl DLL. - delete `INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB"` for "objects" target. Follow-up to2ebc74c36a- delete duplicate `BUILDING_LIBCURL` definitions. - fix `HIDES_CURL_PRIVATE_SYMBOLS` to not overwrite earlier build settings. Follow-up to1199308dbcCloses #11914
This commit is contained in:
parent
826a7c4fb1
commit
a8ebde99f7
2 changed files with 24 additions and 14 deletions
|
|
@ -26,6 +26,12 @@ include(CheckCSourceCompiles)
|
|||
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||
|
||||
if(WIN32 AND ENABLE_CURLDEBUG)
|
||||
# We need to export internal debug functions (e.g. curl_dbg_*), so disable
|
||||
# symbol hiding for debug builds.
|
||||
set(CURL_HIDDEN_SYMBOLS OFF)
|
||||
endif()
|
||||
|
||||
if(CURL_HIDDEN_SYMBOLS)
|
||||
set(SUPPORTS_SYMBOL_HIDING FALSE)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue