Closed fanquake closed 3 weeks ago
Solution: don't use rt if not RT_LIBRARY
rt
RT_LIBRARY
This currently causes the check to fail on macOS:
/Library/Developer/CommandLineTools/usr/bin/c++ -std=c++11 -Wno-tautological-constant-compare -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_8466b.dir/CheckSymbolExists.cxx.o -o cmTC_8466b -lrt ld: library 'rt' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)
even though clock_gettime is available.
clock_gettime
Move the clock_gettime check up with the other librt related checks, and don't set CMAKE_REQUIRED_LIBRARIES if not RT_LIBRARY.
CMAKE_REQUIRED_LIBRARIES
Solution: don't use
rt
if notRT_LIBRARY
This currently causes the check to fail on macOS:
even though
clock_gettime
is available.Move the
clock_gettime
check up with the other librt related checks, and don't setCMAKE_REQUIRED_LIBRARIES
if notRT_LIBRARY
.