[cmake-developers] [CMake 0014503]: Make a library can ``link to'' a objlib

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 22 05:16:26 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14503 
====================================================================== 
Reported By:                icando
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14503
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2013-10-22 05:16 EDT
Last Modified:              2013-10-22 05:16 EDT
====================================================================== 
Summary:                    Make a library can ``link to'' a objlib
Description: 
Objlib is useful implementing self-registration factories, where we rely on
global/static variables' constructor to register itself in a factory.  The major
issue is linker will remove those symbols that are not referenced, and we can
use objlib to force linking these symbols.

Currently the caveat is we need to specify all objlib at add_executable, which
makes it painful.  It would be great if a library can specify objlib in
target_link_libraries or some other new command, and it will pass those objlib
all the way up to the executable, and executable will automatically include
those objlibs as its source.  In this way, we can maintain the alwayslink
requirement where the library is defined, not at top-level.

Thanks.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-22 05:16 icando         New Issue                                    
======================================================================




More information about the cmake-developers mailing list