By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 2985

Summary: Change to use portable way to generate PIC code for static lib in TDEMacros.cmake
Product: TDE Reporter: OBATA Akio <obache>
Component: other (any)Assignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, slavek.banko
Priority: P5    
Version: R14.1.x [Trinity]   
Hardware: Other   
OS: All   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2885    

Description OBATA Akio 2018-11-04 02:23:56 CST
In cmake/modules/TDEMacros.cmake:

  # set -fPIC flag for static libraries
  if( _static_pic )
    set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
  endif( _static_pic )

manually set -fPIC to COMPILE_FLAG property.

Since CMake version 2.8.9, you can use following way instead:

    set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )

This is much portable way, because -fPIC may not be sufficient for some platforms.
Comment 1 Slávek Banko 2018-11-07 06:02:28 CST
Since we still support distributions where CMake is an older version than 2.8.9, we need to use the condition for POSITION_INDEPENDENT_CODE to be used according to the CMake version.
Comment 2 Slávek Banko 2018-11-28 18:27:35 CST
See TDE/tde-common-cmake#3:

https://mirror.git.trinitydesktop.org/gitea/TDE/tde-common-cmake/pulls/3
Comment 3 Slávek Banko 2018-12-03 07:16:52 CST
Fixed by commit e5b3a250fc (master), ed0d46cb (r14.0.x) and e79fbb87 (v3.5.13-sru).