diff options
author | redfish <redfish@galactica.pw> | 2016-08-29 10:58:52 -0400 |
---|---|---|
committer | redfish <redfish@galactica.pw> | 2016-08-30 23:01:48 -0400 |
commit | 1de812a92a1f0b6c9080044e04cb77bc34a2ebe7 (patch) | |
tree | d5ff927722082869d1a8112ada836e7b7cff4ae4 /src/CMakeLists.txt | |
parent | cmake: comply with the new policy CMP0026 (diff) | |
download | monero-1de812a92a1f0b6c9080044e04cb77bc34a2ebe7.tar.xz |
cmake: merge libs via virtual object libraries
CMake issued a warming about policy CMP0026: access of LOCATION
target property at config time was disallowed. Offending code
was the code that merged static libraries to generate
libwallet_merged.a.
This patch does that same merge task in a much simpler way. And,
since it doesn't violate the policy, the warning went away.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 70bb215d0..5a79325ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,8 +82,13 @@ function (bitmonero_add_library name) FILES ${ARGN}) - add_library("${name}" - ${ARGN}) + # Define a ("virtual") object library and an actual library that links those + # objects together. The virtual libraries can be arbitrarily combined to link + # any subset of objects into one library archive. This is used for releasing + # libwallet, which combines multiple components. + set(objlib obj_${name}) + add_library(${objlib} OBJECT ${ARGN}) + add_library("${name}" STATIC $<TARGET_OBJECTS:${objlib}>) set_property(TARGET "${name}" PROPERTY FOLDER "libs") |