[cmake-developers] [CMake 0014968]: -fPIC not properly forwarded through OBJECT libraries

Mantis Bug Tracker mantis at public.kitware.com
Wed Jun 11 12:08:32 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14968 
====================================================================== 
Reported By:                Nico
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14968
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-06-11 12:08 EDT
Last Modified:              2014-06-11 12:08 EDT
====================================================================== 
Summary:                    -fPIC not properly forwarded through OBJECT
libraries
Description: 
When compiling a project that includes an OBJECT library, e.g.,
```
project(mytest C)
add_library(test2 OBJECT test2.c)
add_library(test test.c $<TARGET_OBJECTS:test2>)
```
and if BUILD_SHARED_LIBS is set to ON, the compile switch `-fPIC` will be
correctly added to the sources of `test`, but not to the sources of `test2`. The
library fails to link.

Additional Information: 
The attachment contains a minimal failing example.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-06-11 12:08 Nico           New Issue                                    
2014-06-11 12:08 Nico           File Added: 2014-06-11-fpic-object-lib.tar.bz2  
                 
======================================================================



More information about the cmake-developers mailing list