macOS: Check for utimensat and futimens does not consider deployment target
Building CMake using the macOS 10.13 SDK finds utimensat
and futimens
even if the deployment target is less than 10.13, and older versions do not provide the symbols.
Minimal example with cmake 3.9.0. Using gtest (from our normal build) and a temporary zip file I made with "Compress..." in Finder.
$ cmake -E tar xfz /Developer/SDKs/gtest/gtest-1.7.0.zip
dyld: lazy symbol binding failed: Symbol not found: _futimens
Referenced from: /usr/local/bin/cmake
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _futimens
Referenced from: /usr/local/bin/cmake
Expected in: /usr/lib/libSystem.B.dylib
Abort trap: 6
$ cmake -E tar xfz temp.zip
dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /usr/local/bin/cmake
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _utimensat
Referenced from: /usr/local/bin/cmake
Expected in: /usr/lib/libSystem.B.dylib
Abort trap: 6
Edited by Brad King