On 05/16/2017 05:16 AM, Patrick Boettcher wrote:
> I'd like to use target_link_libraries() on an OBJECT-library
> 
> I started looking into the code, except removing the check in
> cmTargetLinkLibraries.cpp I didn't do much. And this does not make it
> work. 
> 
> Before continuing I'd like to know whether this is a good idea to work
> on or if there are good arguments to never allow "linking" an
> object-library to get compile information from other libraries?

Adding Ben and Robert to Cc who've recently discussed a plan for this.

The reason that object libraries were not made linkable originally
is that the semantics were not clear.  Back then we were only first
starting to do usage requirements besides linking.  Since then things
have matured enough to provide a path forward.

We can't allow target_link_libraries to propagate the object files
themselves because then they could end up in multiple dependent
consumers.  However, we can make target_link_libraries treat OBJECT
libraries just like INTERFACE libraries for all the other usage
requirements.  Once we do that then we can support object libraries
on the left of target_link_libraries too because then the transitive
behavior of the INTERFACE requirements becomes well-defined.

-Brad

-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to