aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-11-06 09:06:05 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-11-06 09:15:01 +0100
commit02dee61044359ac84fe445246576f1f620bc12d6 (patch)
tree552436066f4933e35997540d17aa225b159bf500
parentd46de58c1b5473c3b1bc4421b603553f2c78d366 (diff)
downloadlibssh-02dee61044359ac84fe445246576f1f620bc12d6.tar.gz
libssh-02dee61044359ac84fe445246576f1f620bc12d6.tar.xz
libssh-02dee61044359ac84fe445246576f1f620bc12d6.zip
cmake: Rename static library
This is only compiled for tests and fuzzers! Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/CMakeLists.txt13
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/fuzz/CMakeLists.txt4
3 files changed, 10 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5904ac67..300c28d7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -365,16 +365,17 @@ install(EXPORT libssh-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
if (BUILD_STATIC_LIB)
- add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
- target_compile_options(${LIBSSH_STATIC_LIBRARY}
+ add_library(ssh-static STATIC ${libssh_SRCS})
+ target_compile_options(ssh-static
PRIVATE
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
- target_include_directories(${LIBSSH_STATIC_LIBRARY}
+ target_include_directories(ssh-static
PRIVATE ${LIBSSH_PUBLIC_INCLUDE_DIRS} ${LIBSSH_PRIVATE_INCLUDE_DIRS})
- target_link_libraries(${LIBSSH_STATIC_LIBRARY}
+ target_link_libraries(ssh-static
PUBLIC ${LIBSSH_LINK_LIBRARIES})
+ add_library(ssh::static ALIAS ssh-static)
if (MSVC)
set(OUTPUT_SUFFIX static)
@@ -382,7 +383,7 @@ if (BUILD_STATIC_LIB)
set(OUTPUT_SUFFIX )
endif (MSVC)
set_target_properties(
- ${LIBSSH_STATIC_LIBRARY}
+ ssh-static
PROPERTIES
VERSION
${LIBRARY_VERSION}
@@ -396,7 +397,7 @@ if (BUILD_STATIC_LIB)
if (WIN32)
set_target_properties(
- ${LIBSSH_STATIC_LIBRARY}
+ ssh-static
PROPERTIES
COMPILE_FLAGS
"-DLIBSSH_STATIC"
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8ee2deef..79d38536 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -18,7 +18,7 @@ include_directories(
set(TORTURE_LINK_LIBRARIES
${CMOCKA_LIBRARY}
- ${LIBSSH_STATIC_LIBRARY})
+ ssh::static)
# create test library
add_library(${TORTURE_LIBRARY}
diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
index d8663b51..bfbf9c4e 100644
--- a/tests/fuzz/CMakeLists.txt
+++ b/tests/fuzz/CMakeLists.txt
@@ -4,7 +4,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_executable(ssh_client_fuzzer ssh_client_fuzzer.cpp)
target_link_libraries(ssh_client_fuzzer
PRIVATE
- ${LIBSSH_STATIC_LIBRARY})
+ ssh::static)
set_target_properties(ssh_client_fuzzer
PROPERTIES
COMPILE_FLAGS "-fsanitize=fuzzer"
@@ -14,7 +14,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_executable(ssh_server_fuzzer ssh_server_fuzzer.cpp)
target_link_libraries(ssh_server_fuzzer
PRIVATE
- ${LIBSSH_STATIC_LIBRARY})
+ ssh::static)
set_target_properties(ssh_server_fuzzer
PROPERTIES
COMPILE_FLAGS "-fsanitize=fuzzer"