Alan W. Irwin wrote:
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.
Perhaps adding the flags causes the compiler to be mis-identified
somehow. Can you run with the gcc -g -fvisibility=hidden, and without
on a very simple C only project. Then send me the binary trees from
both. I am suspecting there will be some sort of error in the compiler
id code.
-Bill
--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
_______________________________________________
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