Define CMake library object lists globally

OBJECT collections in CMake don't generate any artifacts so these
are safe to hoist out and define globally.

library OBJECT targets are just a list of filenames.  It can be useful for
other projects to include lists of sources directly regardless of build mode
(shared, static, or library).
This commit is contained in:
Matt Stancliff
2017-01-12 13:41:40 +08:00
parent 9f9fdc0531
commit 63add73d0b
3 changed files with 3 additions and 3 deletions

View File

@@ -749,8 +749,8 @@ else()
add_definitions(-DOPENSSLDIR=\"${CMAKE_INSTALL_PREFIX}/etc/ssl\")
endif()
add_library(crypto-objects OBJECT ${CRYPTO_SRC})
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>)
if (WIN32)