mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
cmake: Rename static library
This is only compiled for tests and fuzzers!
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit 8c36a865f2)
This commit is contained in:
@@ -365,16 +365,20 @@ install(EXPORT libssh-config
|
|||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||||
|
|
||||||
if (BUILD_STATIC_LIB)
|
if (BUILD_STATIC_LIB)
|
||||||
add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
|
add_library(ssh-static STATIC ${libssh_SRCS})
|
||||||
target_compile_options(${LIBSSH_STATIC_LIBRARY}
|
target_compile_options(ssh-static
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${DEFAULT_C_COMPILE_FLAGS}
|
${DEFAULT_C_COMPILE_FLAGS}
|
||||||
-D_GNU_SOURCE)
|
-D_GNU_SOURCE)
|
||||||
|
|
||||||
target_include_directories(${LIBSSH_STATIC_LIBRARY}
|
target_include_directories(ssh-static
|
||||||
PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS})
|
PUBLIC
|
||||||
target_link_libraries(${LIBSSH_STATIC_LIBRARY}
|
$<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
PRIVATE ${LIBSSH_PRIVATE_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(ssh-static
|
||||||
PUBLIC ${LIBSSH_LINK_LIBRARIES})
|
PUBLIC ${LIBSSH_LINK_LIBRARIES})
|
||||||
|
add_library(ssh::static ALIAS ssh-static)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(OUTPUT_SUFFIX static)
|
set(OUTPUT_SUFFIX static)
|
||||||
@@ -382,7 +386,7 @@ if (BUILD_STATIC_LIB)
|
|||||||
set(OUTPUT_SUFFIX )
|
set(OUTPUT_SUFFIX )
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
ssh-static
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
VERSION
|
VERSION
|
||||||
${LIBRARY_VERSION}
|
${LIBRARY_VERSION}
|
||||||
@@ -396,7 +400,7 @@ if (BUILD_STATIC_LIB)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
ssh-static
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
"-DLIBSSH_STATIC"
|
"-DLIBSSH_STATIC"
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ include_directories(
|
|||||||
|
|
||||||
set(TORTURE_LINK_LIBRARIES
|
set(TORTURE_LINK_LIBRARIES
|
||||||
${CMOCKA_LIBRARY}
|
${CMOCKA_LIBRARY}
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
ssh::static)
|
||||||
${LIBSSH_LINK_LIBRARIES})
|
|
||||||
|
|
||||||
# create test library
|
# create test library
|
||||||
add_library(${TORTURE_LIBRARY}
|
add_library(${TORTURE_LIBRARY}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set(pkd_hello_src
|
|||||||
|
|
||||||
set(pkd_libs
|
set(pkd_libs
|
||||||
${CMOCKA_LIBRARY}
|
${CMOCKA_LIBRARY}
|
||||||
${LIBSSH_STATIC_LIBRARY}
|
ssh::static
|
||||||
${ARGP_LIBRARIES}
|
${ARGP_LIBRARIES}
|
||||||
pthread
|
pthread
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user