尝试运行cmake
以使用以下内容创建Xcode项目:
cmake -G Xcode ..
在Xcode 13及更低版本下,这个程序一直运行得很好。但是在Xcode 14测试版下,如果突然失败,我会得到下面的输出:
-- Found Git: /usr/bin/git (found version "2.32.1 (Apple Git-133)")
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.9", minimum required is "3")
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:17 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:17 (project):
No CMAKE_CXX_COMPILER could be found.
CMakeFiles/CMakeError.log
的更多详细信息包括:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
error: An empty identity is not valid when signing a binary for the product type 'Command-line Tool'. (in target 'CompilerIdC' from project 'CompilerIdC')
这是怎么回事,我该怎么解决?
2条答案
按热度按时间unguejic1#
更新至至少可执行make v3.23.3; cmake会在内部将CODE_SIGN_IDENTITY设置为“-"。在v3.23.3之前的版本中,尝试设置CODE_SIGN_IDENTITY="-”仍会产生空标识错误。
avwztpqn2#
我以前遇到过类似问题,我不记得具体哪一个有帮助,但希望其中一个能帮助您:
CODE_SIGN_IDENTITY
问题-https://gitlab.kitware.com/cmake/cmake/-/issues/236091.从apple下载xcode 14测试版命令行工具
1.运行
sudo xcodebuild -license
(https://stackoverflow.com/a/59556807)1.请尝试在脚本中进行设置:
-DCMAKE_C_COMPILER="$(xcrun -find cc)"
和-DCMAKE_CXX_COMPILER="$(xcrun -find c++)"
(CMake错误,使用Xcode和GLFW无法找到CMAKE_C_COMPILER)