cmake: lib CURL_STATICLIB fixes (Windows)#11914
Conversation
47486c0 to
7930b65
Compare
|
A new issue came up: https://ci.appveyor.com/project/curlorg/curl/build/job/8olkqly0nb6yb2v9 (CMake, VS2008, Release x86, Schannel) Plus there is |
a383659 to
d182de9
Compare
|
Solved the This relies on CMake merging the two UPDATE: Seems to require CMake 3.12.0, so this solution is doubly no good. |
c0a1076 to
91a8ced
Compare
91a8ced to
0cdc24e
Compare
|
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:
|
|
Next issues:
UPDATE: fixed. |
|
Tending to prefer the option 'Export all symbols for debug builds' as a reasonable compromise. This makes it unnecessary to roll a |
|
Strange error from a single CI job for the test added in this PR: Ref: https://github.com/curl/curl/actions/runs/6281395226/job/17062947662?pr=11914#step:11:3161 |
124f2a4 to
33dab5f
Compare
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
33dab5f to
aaba2c8
Compare
CURL_STATICLIB fixes
CURL_STATICLIB fixesCURL_STATICLIB fixes (Windows)
CURL_STATICLIB fixes (Windows)CURL_STATICLIB fixes (Windows)
aaba2c8 to
363e76d
Compare
We already used `WINDOWS_EXPORT_ALL_SYMBOLS` in `CMake/CurlSymbolHiding.cmake` for MSVC, but that was limited to cases when hiding symbols explicitly. We need to do this also when disabling symbol hiding automtically for debug builds.
363e76d to
0b0bb76
Compare
84d1072 to
75655f1
Compare
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`.
c81157e to
399d17b
Compare
Also fix to export all symbols in Windows debug builds, making `-debug-dyn` builds work with `-DCURL_STATICLIB` set. Ref: curl#11914 (same for CMake) Closes curl#11924
always define
CURL_STATICLIBwhen 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 exportedby default.
Regression from 1199308
Fixes When building a static library project for Visual Studio with CMake, the preprocessor variable CURL_STATICLIB does not get set #11844
fix to omit
libcurl.defwhen not hiding private symbols.Regression from 2ebc74c
fix
ENABLED_DEBUG=ON+ shared curl tool Windows builds by alsoomitting
libcurl.defin this case, and exporting all symbolsinstead. 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_LIBCURLdefinitions.fix
HIDES_CURL_PRIVATE_SYMBOLSto not overwrite earlier build settings.Follow-up to 1199308
Closes #11914