From 63add73d0b5b49ea583e12610799d2de80877a7d Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 12 Jan 2017 13:41:40 +0800 Subject: [PATCH] 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). --- crypto/CMakeLists.txt | 2 +- ssl/CMakeLists.txt | 2 +- tls/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 2b48d32..dd0e569 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -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 $) add_library(crypto-shared SHARED $) if (WIN32) diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index 5866e8e..d511c8e 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt @@ -48,8 +48,8 @@ set( t1_srvr.c ) +add_library(ssl-objects OBJECT ${SSL_SRC}) if (BUILD_SHARED) - add_library(ssl-objects OBJECT ${SSL_SRC}) add_library(ssl STATIC $) add_library(ssl-shared SHARED $) if (WIN32) diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index e384808..1f78038 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt @@ -29,8 +29,8 @@ else() add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\") endif() +add_library(tls-objects OBJECT ${TLS_SRC}) if (BUILD_SHARED) - add_library(tls-objects OBJECT ${TLS_SRC}) add_library(tls STATIC $) add_library(tls-shared SHARED $) if (WIN32)