Do not build lib-objects targets if we are just building static libs.

This confuses some cmake targets.
This commit is contained in:
Brent Cook 2015-09-09 05:15:06 -05:00
parent 5f4e95e7c1
commit adfb2bf722
4 changed files with 26 additions and 25 deletions

View File

@ -36,6 +36,8 @@ add_definitions(-DLIBRESSL_INTERNAL)
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
add_definitions(-DOPENSSL_NO_ASM)
set(CMAKE_POSITION_INDEPENDENT_CODE true)
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_definitions(-Wno-pointer-sign)
endif()

View File

@ -638,16 +638,16 @@ if(NOT HAVE_TIMINGSAFE_MEMCMP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c)
endif()
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
set_property(TARGET crypto-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
set(CRYPTO_TARGETS crypto)
if (BUILD_SHARED)
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>)
add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>)
set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto)
set_target_properties(crypto-shared PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
set(CRYPTO_TARGETS ${CRYPTO_TARGETS} crypto-shared)
set_target_properties(crypto-shared PROPERTIES VERSION
${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION})
install(TARGETS crypto crypto-shared DESTINATION lib)
else()
add_library(crypto STATIC ${CRYPTO_SRC})
install(TARGETS crypto DESTINATION lib)
endif()
install(TARGETS ${CRYPTO_TARGETS} DESTINATION lib)

View File

@ -50,16 +50,15 @@ set(
t1_srvr.c
)
add_library(ssl-objects OBJECT ${SSL_SRC})
set_property(TARGET ssl-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
set(SSL_TARGETS ssl)
if (BUILD_SHARED)
add_library(ssl-objects OBJECT ${SSL_SRC})
add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>)
add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>)
set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl)
set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} SOVERSION ${SSL_MAJOR_VERSION})
set(SSL_TARGETS ${SSL_TARGETS} ssl-shared)
set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION}
SOVERSION ${SSL_MAJOR_VERSION})
install(TARGETS ssl ssl-shared DESTINATION lib)
else()
add_library(ssl STATIC ${SSL_SRC})
install(TARGETS ssl DESTINATION lib)
endif()
install(TARGETS ${SSL_TARGETS} DESTINATION lib)

View File

@ -19,16 +19,16 @@ if(NOT HAVE_STRCASECMP)
set(TLS_SRC ${TLS_SRC} strsep.c)
endif()
add_library(tls-objects OBJECT ${TLS_SRC})
set_property(TARGET tls-objects PROPERTY POSITION_INDEPENDENT_CODE 1)
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
set(TLS_TARGETS tls)
if (BUILD_SHARED)
add_library(tls-objects OBJECT ${TLS_SRC})
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls)
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION})
set(TLS_TARGETS ${TLS_TARGETS} tls-shared)
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
SOVERSION ${TLS_MAJOR_VERSION})
install(TARGETS tls tls-shared DESTINATION lib)
else()
add_library(tls STATIC ${TLS_SRC})
install(TARGETS tls DESTINATION lib)
endif()
install(TARGETS ${TLS_TARGETS} DESTINATION lib)