I often build with

export CC='gcc -g -fvisibility=hidden
export CXX='g++ -g -fvisibility=hidden'
and
export FC='gfortran -g -fvisibility=hidden'

but recently this has quit working because CMake fails to add the necessary -fPIC flag to shared library builds.

Sorry I don't know the last CMake version where this worked, but I am pretty
sure I have used this sort of build successfully for earlier versions of
2.8.x, and definitely for cmake-2.6.4.

If I specify the flags another way, e.g.,

cmake -DCMAKE_C_FLAGS:STRING="-g -fvisibility=hidden" \
-DCMAKE_CXX_FLAGS:STRING="-g -fvisibility=hidden" \
-DCMAKE_Fortran_FLAGS:STRING="-g -fvisibility=hidden" \
...

the necessary -fPIC flag for shared libraries is added in properly. However,
I would like the more convenient (set and forget) environment variable
approach to continue to work as previously.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
Powered by www.kitware.com

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

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

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

Reply via email to