[cmake-developers] Usage Requirements with Object Libraries
Gößwein Matthias / eeas gmbh
matthias.goesswein at eeas.at
Wed Apr 11 10:48:56 EDT 2018
Hello,
Right now I'm using a nightly build (3.11.20180407-g268d0) to use and
test the Usage Requirements with Object Libraries, which is planned for
CMake 3.12.0 (https://gitlab.kitware.com/cmake/cmake/issues/14778)
It's working great so far, but I if i have a construct of two object
libraries, which depend in some way of each other I get an error message:
CMake Error: The inter-target dependency graph contains the following
strongly connected component (cycle):
"lib1" of type OBJECT_LIBRARY
depends on "lib2" (strong)
"lib2" of type OBJECT_LIBRARY
depends on "lib1" (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic
dependencies are allowed only among static libraries.
CMakeLists.txt:
add_library(lib1 OBJECT lib1.c)
target_link_libraries(lib1 PUBLIC lib2)
add_library(lib2 OBJECT lib2.c)
target_link_libraries(lib2 PUBLIC lib1)
If i use Static libraries, then it works (in fact even if only one
library is an object library it fails). Is it possible to implement the
same thing for object libraries too, or are there some technical
restrictions?
In the past i had sometimes such cyclic dependencies with legacy code
and i think it would be great if it is possible to support such
dependencies with object libraries as well.
Best regards,
Matthias Goesswein.
--
matthias.goesswein at eeas.at /mail
www.eeas.at /web
+43 660 1280 131 /phone
------------------------------
eeas gmbh
Technologiepark 17
4320 Perg
Austria
------------------------------
ATU67456549 /uid
FN385458a /firmenbuchnummer
landesgericht linz /firmenbuch
More information about the cmake-developers
mailing list