CURL_STATICLIB fixes (Windows)
A new issue came up:
https://ci.appveyor.com/project/curlorg/curl/build/job/8olkqly0nb6yb2v9 (CMake, VS2008, Release x86, Schannel)
Plus there is
This relies on CMake merging the two
UPDATE: Seems to require CMake 3.12.0, so this solution is doubly no good.
Solved this one by extending
This perhaps isn't the most elegant solution, but I cannot think of a better one. Other alternatives may be to:
…d settings Regression from 1199308
…bjects" target Follow-up to 2ebc74c
Strange error from a single CI job for the test added in this PR:
Symbol hiding options are enabled by default and with clang/gcc toolchains it adds the `-fvisibility=hidden` linker option. We need to disable it to make debug builds export all symbols from libcurl DLL with these compilers. This case misses CI coverage. (mingw-w64, debug with shared lib only (or static+shared and BUILD_STATIC_CURL=OFF) while linking libcurl DLL statically with dependencies exporting their symbols.)
This ensures that any symbol-hiding compiler option is used everywhere and it also makes it unnecessary to repeat the MSVC-specific option `WINDOWS_EXPORT_ALL_SYMBOLS=ON`.
- 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 from 1199308 Fixes curl#11844 - fix to omit `libcurl.def` when not hiding private symbols. Regression from 2ebc74c - 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 to 2ebc74c - delete duplicate `BUILDING_LIBCURL` definitions. - fix `HIDES_CURL_PRIVATE_SYMBOLS` to not overwrite earlier build settings. Follow-up to 1199308 Closes curl#11914