[cmake-developers] patch that adds -KPIC flag to SunPro Fortran compiler

Steven Vancoillie steven.vancoillie at teokem.lu.se
Mon Mar 23 04:37:28 EDT 2015


On Mar 20 [13:08], Brad King wrote:
> On 03/20/2015 04:23 AM, Steven Vancoillie wrote:
> > Looking at other compiler configurations, it seems it might be better
> > to have a SunPro.cmake module that combines flags that are independent
> > of the language?
> 
> Yes.  This refactoring has simply not been done for this compiler.
> If you want to work on it, please note that such a module is not
> loaded automatically and must be included by the per-language
> modules.  This pattern is visible in several other compiler modules.

I've included a candidate patch for this refactoring.

I also noticed the follow variables are set for C, CSS, and ASM:

  set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Bstatic")
  set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Bdynamic")

I could add these for Fortran as well and move it also to the
macro in SunPro.cmake. However, since this only seems to be there
for SunPro, I wondered if these are used at all? These options are
just passed to ld, so they are not sun-specific.

grtz
Steven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Combine-SunPro-compiler-flags-for-multiple-languages.patch
Type: text/x-diff
Size: 8171 bytes
Desc: 0001-Combine-SunPro-compiler-flags-for-multiple-languages.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150323/8bd5f32f/attachment.patch>


More information about the cmake-developers mailing list