1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

cmake: dedupe setting -DHAVE_CONFIG_H

Move `libssh2_config.h` generation and setting `-DHAVE_CONFIG_H` to
the root `CMakeFile.txt`.

Also move symbol hiding setup there. It needs to be done before
generating the config file for `LIBSSH2_API` value to be set in it.

After this change the `HIDE_SYMBOLS` setting is accepted without an
annoying CMake warning when not actually building a shared libssh2 lib.

Closes #981
This commit is contained in:
Viktor Szakats
2023-04-18 08:20:05 +00:00
parent 191c4e8c71
commit 803f19f004
4 changed files with 27 additions and 31 deletions

View File

@ -37,8 +37,6 @@ include(CopyRuntimeDependencies)
list(APPEND LIBRARIES ${SOCKET_LIBRARIES})
add_definitions(-DHAVE_CONFIG_H)
transform_makefile_inc("Makefile.am" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.am.cmake")
# Get 'noinst_PROGRAMS' variable
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.am.cmake)