Skip to content

Add -fPIC (or equivalent) compiler flag to SPack Compiler Wrappers #508

@citibeth

Description

@citibeth

This would allow packages producing shared libraries to link to packages producing only static libraries, even if the static library packages not add -fPIC in their build.

@mathstuf said:

Well, it's not always spelled '-fPIC', but yes, this makes sense. Here's
CMake's "table" of -fPIC flags:

Modules/Compiler/GNU.cmake:  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
Modules/Compiler/NAG-Fortran.cmake:set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC")
Modules/Compiler/SCO.cmake:  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Kpic)
Modules/Compiler/SunPro-C.cmake:set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
Modules/Compiler/SunPro-CXX.cmake:set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
Modules/Compiler/SunPro-Fortran.cmake:set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-KPIC")
Modules/Compiler/XL.cmake:  set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions