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.goessw...@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


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers

Reply via email to