Repository navigation
Conversation
vszakats
force-pushed
the
cmake-hidden-symbols
branch
from
April 9, 2023 09:01
b6d99f7 to
c4334de
Compare
HIDE_SYMBOLS option & fix symbol hiding on *nix
HIDE_SYMBOLS option & fix symbol hiding on *nixHIDE_SYMBOLS option & do symbol hiding on *nix
- implement symbol hiding on non-Windows platforms. The essence of the detection logic was copied from: https://github.com/curl/curl/blob/dfabe8bca218d2524af052bd551aa87e13b8a10b/CMake/CurlSymbolHiding.cmake Then simplified and shortened. This method doesn't require a recent CMake version, nor an external, auto-generated C header. Move `configure_file()` after `set(LIBSSH2_API ...)`, for the config file to pick up `LIBSSH2_API`s value. Closes libssh2#602 - add CMake option `HIDE_SYMBOLS`. This setting means to hide non-public functions from the libssh2 dynamic library when set to `ON`. The default. When set to `OFF`, make all non-static/internal functions visible in the dynamic library. This setting requires `BUILD_SHARED_LIBS=ON`. - honor this setting on Windows. By setting the `LIBSSH2_EXPORTS` manual macro again, and stop recognizing the automatic CMake macro for this purpose: `libssh2_shared_EXPORT`. Closes libssh2#939 only with shared libs enabled
vszakats
force-pushed
the
cmake-hidden-symbols
branch
from
April 9, 2023 09:03
c4334de to
4b7d6c9
Compare
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
- implement symbol hiding on non-Windows platforms. The essence of the detection logic was copied from: https://github.com/curl/curl/blob/dfabe8bca218d2524af052bd551aa87e13b8a10b/CMake/CurlSymbolHiding.cmake Then simplified and shortened. This method doesn't require a recent CMake version, nor an external, auto-generated C header. Move `configure_file()` after `set(LIBSSH2_API ...)`, for the config file to pick up `LIBSSH2_API`s value. Closes libssh2#602 - add CMake option `HIDE_SYMBOLS`. This setting means to hide non-public functions from the libssh2 dynamic library when set to `ON`. The default. When set to `OFF`, make all non-static/internal functions visible in the dynamic library. This setting requires `BUILD_SHARED_LIBS=ON`. - honor this setting on Windows. By setting the `LIBSSH2_EXPORTS` manual macro again, and stop recognizing the automatic CMake macro for this purpose: `libssh2_shared_EXPORT`. Closes libssh2#939
1 task
vszakats
added a commit
that referenced
this pull request
Sep 29, 2025
- prefer `set_property()` over `target_compile_options()`, to use the modern style. Follow-up to 8017592 #939 - prefer to append to compiler/linker options in examples/tests. To prevent accidentally overriding a previously set option. Follow-up to 14a709a #1686 Follow-up to 854cfa8 #1524 - replace `LINK_FLAGS` with `LINK_OPTIONS` that superceded it, for CMake 3.13+. Follow-up to 854cfa8 #1524 https://cmake.org/cmake/help/v4.1/prop_tgt/LINK_OPTIONS.html Closes #1690
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
implement symbol hiding on non-Windows platforms.
The essence of the detection logic was copied from: https://github.com/curl/curl/blob/dfabe8bca218d2524af052bd551aa87e13b8a10b/CMake/CurlSymbolHiding.cmake
Then simplified and shortened. This method doesn't require a recent CMake version, nor an external, auto-generated C header.
Move
configure_file()afterset(LIBSSH2_API ...), for the config file to pick upLIBSSH2_APIs value.Closes [CMake] Set the visibility to hidden and only export the API symbols #602
add CMake option
HIDE_SYMBOLS.This setting means to hide non-public functions from the libssh2 dynamic library when set to
ON. The default.When set to
OFF, make all non-static/internal functions visible in the dynamic library.This setting requires
BUILD_SHARED_LIBS=ON.honor this setting on Windows.
By setting the
LIBSSH2_EXPORTSmanual macro again, and stop recognizing the automatic CMake macro for this purpose:libssh2_shared_EXPORT.Closes #939