Keep relinking on AIX
Please help, my platform is AIX7.2 and ther version of cmake 3.16.0:
[doufu@AIX_SER:~/Demo3]$ uname -s
AIX
[doufu@AIX_SER:~/Demo3]$ oslevel -s
7200-02-03-1845
[doufu@AIX_SER:~/Demo3]$ cmake --version
cmake version 3.16.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
My project's(Demo3.zip) structure:
[doufu@AIX_SER:~/Demo3]$ ls -R *
CMakeLists.txt main.cc
math:
CMakeLists.txt MathFunctions.cc MathFunctions.h
build:
....
math folder contain's a static library named libMathFunctions.a.
This project will keep relinking at compile time,(but Debian-11 is well). According to the output, the reason for this behavior is:
Deleting primary custom command output "/home/doufu/Demo3/build/math/libMathFunctions.a" because another output "/home/doufu/Demo3/build/math/libMathFunctions" does not exist.
This dependency information is locate in math/CMakeFiles/MathFunctions.dir/DependInfo.cmake:
[doufu@AIX_SER:~/Demo3/build]$ cat math/CMakeFiles/MathFunctions.dir/DependInfo.cmake
...
# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
)
# Pairs of files generated by the same build rule. ##### cause problem #####
set(CMAKE_MULTIPLE_OUTPUT_PAIRS
"/home/doufu/Demo3/build/math/libMathFunctions" "/home/doufu/Demo3/build/math/libMathFunctions.a"
"/home/doufu/Demo3/build/math/libMathFunctions.so" "/home/doufu/Demo3/build/math/libMathFunctions.a"
)
# Targets to which this target links.
...
Why libMathFunctions.a has other outputs, or why libMathFunctions.a depends on libMathFunctions/libMathFunctions.so on AIX?
Edited by dou fu