[CMake] Regression between 2.4.8 and 2.6.2 for the macada version of the gcc compiler

Brad King brad.king at kitware.com
Wed Jan 28 17:15:11 EST 2009


Alan W. Irwin wrote:
> The issue can be illustrated by a simple "hello-world" shared library
> build test project with SOVERSION and VERSION specified for the library.

 From "make.out_gcc_macada_2.6.2":
----------------------------------------------------------------------------------
/usr/local/ada-4.3/bin/gcc   -dynamiclib -headerpad_max_install_names 
-Wl,-current_version,0.0.1 -o libHello.0.0.1.dylib -install_name 
/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib 
CMakeFiles/Hello.dir/hello.c.o
/usr/bin/ld: unknown flag: -current_version
----------------------------------------------------------------------------------

CMake is passing '-Wl,-current_version' to the compiler, which is 
supposed to blindly pass it to the linker.  Then the *linker* is 
complaining it doesn't know about the flag.  I guess collect2 knows 
about the flag but ld does not.  What interface does macada gcc provide 
to set these fields in the binaries?

The workaround is to erase the settings from Darwin.cmake:

SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG)
SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG)
SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG)
SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG)

-Brad


More information about the CMake mailing list