[CMake] problems with creating static library on aix

Verweij, Arjen VerweijA at tass-safe.com
Tue Jul 6 12:55:22 EDT 2010


Hi,

We're experiencing two problems with creating static libraries through cmake on our AIX system.

The first one is that a cmake based build environment will come up with 64-bit XCOFF, but ar and friends won't play ball unless you add -X64. I suppose this issue has just been overlooked and is in fact minor.

The other problem is that even though I have added the below workaround referenced in a thread from July '08, "ar cr" will choke on the amount or objects I'm feeding it. I'm sure this is a problem with the ar itself and not cmake, but I would be interested to learn of a possible workaround. It works fine for smaller archives.

Thanks,
Arjen

SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> -X64 r  <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X64 <TARGET>")
SET(CMAKE_CXX_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
SET(CMAKE_CXX_ARCHIVE_APPEND ${CMAKE_C_ARCHIVE_APPEND})
SET(CMAKE_CXX_ARCHIVE_FINISH ${CMAKE_C_ARCHIVE_FINISH})
SET(CMAKE_Fortran_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
SET(CMAKE_Fortran_ARCHIVE_APPEND ${CMAKE_C_ARCHIVE_APPEND})
SET(CMAKE_Fortran_ARCHIVE_FINISH ${CMAKE_C_ARCHIVE_FINISH})


More information about the CMake mailing list