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

@@ -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)