-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
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:
|
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_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 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.def
when not hiding private symbols.Regression from 2ebc74c
fix
ENABLED_DEBUG=ON
+ shared curl tool Windows builds by alsoomitting
libcurl.def
in 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_LIBCURL
definitions.fix
HIDES_CURL_PRIVATE_SYMBOLS
to not overwrite earlier build settings.Follow-up to 1199308
Closes #11914