Building C code for MacOSX. Have a file that references libc.h.
Xcode 13 (with command line tools installed): built fine from Xcode or Make
Xcode 14 (with command line tools installed): builds fine from Xcode. Fails to build from make with error that libc.h cannot be found.
libc.h exists in /Applications/Xcode.app/Contents//Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libc.h but I don’t know how to make sure that CMake with the default generator can find this.
because the directory does not exist.
Call Stack (most recent call first):
And the CMakeTestCCompiler.cmake failed.
Did a fresh build in a fresh directory and it worked.
I had assumed running “cmake .” in the build directory would reconfigure the entire project, but it seems not.
When the compiler changes, it is recommended to start fresh if anything goes wrong (CMake already does this if the compiler path is detected to have changed). This includes updating Xcode as paths found and cached may need to be rediscovered as the SDK details that get cached can change over time (as you found out).
It does, but knowing what cache values are stale is a hard problem.