dandelion 编译报错

报错信息如下

cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug
CMake Warning at /opt/homebrew/Cellar/cmake/3.30.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake:311 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk

  because the directory does not exist.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.30.1/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:34 (include)
  CMakeLists.txt:2 (project)


Current build type: Debug
-- Using Cocoa for window creation
-- {fmt} version: 11.0.2
-- Build type: Debug
-- Shared libraries disabled
-- compiling zlib from sources
INFO Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.
-- Enabled importer formats: COLLADA OBJ FBX
-- Disabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH DXF CSM HMP IRRMESH IQM IRR LWO LWS M3D MD2 MD3 MD5 MDC MDL NFF NDO OFF OGRE OPENGEX PLY MS3D COB BLEND IFC XGL Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
-- Enabled exporter formats:
-- Disabled exporter formats: OBJ OPENGEX PLY 3DS ASSBIN ASSXML M3D COLLADA FBX STL X X3D GLTF 3MF PBRT ASSJSON STEP
-- Treating all warnings as errors (for assimp library only)
-- Configuring done (0.1s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/zilong/coding/graphics/dandelion/build
❯ cmake --build . --parallel 8
[  0%] Building CXX object deps/fmt/CMakeFiles/fmt.dir/src/os.cc.o
[  1%] Building CXX object deps/fmt/CMakeFiles/fmt.dir/src/format.cc.o
[  1%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/crc32.c.o
[  1%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/gzclose.c.o
[  2%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/adler32.c.o
[  2%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/compress.c.o
[  3%] Building C object deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/deflate.c.o
[  4%] Building C object deps/glfw/src/CMakeFiles/glfw.dir/context.c.o
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/gzclose.c:6:
/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/gzguts.h:21:10: fatal error: 'stdio.h' file not found
   21 | #include <stdio.h>
      |          ^~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/src/format.cc:8:
/Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/format-inl.h:12:12: fatal error: 'algorithm' file not found
   12 | #  include <algorithm>
      |            ^~~~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/src/os.cc:13:
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/os.h:11:
In file included from /Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/format.h:41:
/Users/zilong/coding/graphics/dandelion/deps/fmt/include/fmt/base.h:17:12: fatal error: 'stdio.h' file not found
   17 | #  include <stdio.h>   // FILE
      |            ^~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/crc32.c:31:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:22:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/adler32.c:8:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:22:
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h:In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/compress.c:9In file included from :
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/deflate.c::3452:
:
In file included from /Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h446/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h/Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/deflate.h:446::::141644614:::
  In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zutil.h:fatal error: 22:
fatal error: 'sys/types.h' file not found
In file included from /Users/zilong/coding/graphics/dandelion/deps/assimp/contrib/zlib/zlib.h:34:
:/Users/zilong/coding/graphics/dandelion/build/deps/assimp/contrib/zlib/zconf.h:446:14:   fatal error: 446 | #    14: fatal error: 'sys/types.h' file not foundin
'sys/types.h' file not foundclu  446 | de <sys/ty'sys/types.h' file not found#

 pes.h>  446 | #    446       / *  | f#o    in c rl uoidfne <sys/tcylpes.h>  i n c l u/d*e  f<osrysf/_t *ud et /y
p      e| ofsf<.shy>_s t /   *              ^~~~~~~~~~~~~/

|              ^~~~~~~~~~~~~
t ype/s.h>      /** f ofro ro foff_ft_ t* /*/

|       |              ^~~~~~~~~~~~~
             ^~~~~~~~~~~~~
In file included from /Users/zilong/coding/graphics/dandelion/deps/glfw/src/context.c:30:
In file included from /Users/zilong/coding/graphics/dandelion/deps/glfw/src/internal.h:184:
/Users/zilong/coding/graphics/dandelion/deps/glfw/src/cocoa_platform.h:28:10: fatal error: 'dlfcn.h' file not found
   28 | #include <dlfcn.h>
      |          ^~~~~~~~~
1111 error generated error error generated generated.
 error generated.
.
.
1 error generated.
1 error generated.
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/deflate.c.o] Error 1
make[2]: *** [deps/glfw/src/CMakeFiles/glfw.dir/context.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/crc32.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/adler32.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/gzclose.c.o] Error 1
make[2]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/compress.c.o] Error 1
make[1]: *** [deps/assimp/contrib/zlib/CMakeFiles/zlibstatic.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [deps/glfw/src/CMakeFiles/glfw.dir/all] Error 2
1 error generated.
make[2]: *** [deps/fmt/CMakeFiles/fmt.dir/src/os.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [deps/fmt/CMakeFiles/fmt.dir/src/format.cc.o] Error 1
make[1]: *** [deps/fmt/CMakeFiles/fmt.dir/all] Error 2
make: *** [all] Error 2

求助一下这个报错信息是怎么回事

有几处地方已经比较明显了,比如

CMake Warning at /opt/homebrew/Cellar/cmake/3.30.1/share/cmake/Modules/Platform/Darwin-Initialize.cmake:311 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk

以及

   21 | #include <stdio.h>
      |          ^~~~~~~~~

可以看出你的系统里没有安装 MacOSX SDK,报的问题都是找不到 C/C++ 标准库。我对 macOS 上的 C/C++ 开发环境不太熟悉,但印象中相关的 SDK 应该是随着 Xcode 一起安装的?建议你检查一下自己 Xcode 和 AppleClang 的安装完整性,看看能不能编译一个最简单的空 C++ project。

export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_SYSROOT=$SDKROOT

这个解决了