swig module add -fPIC flag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

swig module add -fPIC flag

Stéphane Ancelot
Hi,

I have not found how to add -fPIC link flag to a SWIG module.

Regards

S.Ancelot

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: swig module add -fPIC flag

CHEVRIER, Marc

swig modules created with command SWIG_ADD_LIBRARY are "standard" CMake targets so, same approach apply.


From convenience, you can use command SWIG_LINK_LIBRARIES (same semantic as TARGET_LINK_LIBRARIES) to manage custom link flags.


Now, regarding specifically flag -fPIC you can manage more easily and in a portable way the 'Position Independent Code' generation by setting variable CMAKE_POSITION_INDEPENDENT_CODE=ON. And I think this flag is for the compiler, not the linker...



From: CMake <[hidden email]> on behalf of Stéphane Ancelot <[hidden email]>
Sent: Wednesday, April 25, 2018 3:40:45 PM
To: [hidden email]
Subject: [CMake] swig module add -fPIC flag
 
Hi,

I have not found how to add -fPIC link flag to a SWIG module.

Regards

S.Ancelot

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake