Xcode: LINK_DEPENDS_NO_SHARED not working
LINK_DEPENDS_NO_SHARED should prevent relinking of dependent dylibs. It works with Makefile generator, but not Xcode. It used to work some time ago.
cmake version 3.22.0 Xcode Version 13.1 (13A1030d)
Details:
unzip newBS.zip
mkdir build
cd build
cmake -DCMAKE_LINK_DEPENDS_NO_SHARED=ON <path to newBS>
make -j10
=> full build happens
add a space in <path to newBS>/a.cpp
make -j10
=> as expected, a.cpp is compiled and ONLY a.dylib is linked
mkdir build2
cd build2
cmake -GXcode -DCMAKE_LINK_DEPENDS_NO_SHARED=ON <path to newBS>
Open Xcode project, build
=> full build happens
add a space in <path to newBS>/a.cpp
build
=> Observed: a.cpp is compiled and ALL libs {a,b,c,d,e,f,g}.dylib are linked => Expected: a.cpp is compiled and ONLY a.dylib is linked
With a large project containing >200 dylib targets, I have incremental build times of several minutes due to recursive relinking.