Xcode: Determining CMAKE_C_COMPILER and CMAKE_CXX_COMPILER fails on Xcode 14-beta
Tested latest CMake nightly with Xcode 14-beta:
$ cmake --version
cmake version 3.24.20220608-g52c8cb1
$ cat CMakeLists.txt
project(test)
$ cmake -GXcode -S. -Bbuild
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:1 (project):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "/Users/remyjette/src/test/build/CMakeFiles/CMakeOutput.log".
See also "/Users/remyjette/src/test/build/CMakeFiles/CMakeError.log"
$ cat build/CMakeFiles/CMakeError.log
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
65
2022-06-09 13:24:50.479 xcodebuild[56634:2508908] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x6000014592d0:'/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk'>': SDK with name 'macosx13.0' being superseded by SDK with 'macosx13.0'.
Command line invocation:
/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2022-06-09 13:24:51.251 xcodebuild[56634:2508930] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-06-09 13:24:51.252 xcodebuild[56634:2508930] nil host used in call to allowsAnyHTTPSCertificateForHost:
note: Planning
Create build description
Build description signature: fa05382a1efbff1a76c6e48029446ed4
Build description path: /Users/remyjette/src/test/build/CMakeFiles/3.24.20220608-g52c8cb1/CompilerIdC/./XCBuildData/fa05382a1efbff1a76c6e48029446ed4-desc.xcbuild
note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
error: An empty identity is not valid when signing a binary for the product type 'Command-line Tool'. (in target 'CompilerIdC' from project 'CompilerIdC')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'CompilerIdC' from project 'CompilerIdC')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'CompilerIdC' from project 'CompilerIdC')
** BUILD FAILED **
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
65
2022-06-09 13:24:52.617 xcodebuild[56639:2509006] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x600002b54c40:'/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk'>': SDK with name 'macosx13.0' being superseded by SDK with 'macosx13.0'.
Command line invocation:
/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2022-06-09 13:24:53.381 xcodebuild[56639:2509025] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-06-09 13:24:53.381 xcodebuild[56639:2509025] nil host used in call to allowsAnyHTTPSCertificateForHost:
note: Planning
Create build description
Build description signature: af8acb997cae346520acdfa02e7856b3
Build description path: /Users/remyjette/src/test/build/CMakeFiles/3.24.20220608-g52c8cb1/CompilerIdC/./XCBuildData/af8acb997cae346520acdfa02e7856b3-desc.xcbuild
note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
error: An empty identity is not valid when signing a binary for the product type 'Command-line Tool'. (in target 'CompilerIdC' from project 'CompilerIdC')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'CompilerIdC' from project 'CompilerIdC')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'CompilerIdC' from project 'CompilerIdC')
** BUILD FAILED **
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
65
2022-06-09 13:24:54.738 xcodebuild[56644:2509085] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x600001238d20:'/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk'>': SDK with name 'macosx13.0' being superseded by SDK with 'macosx13.0'.
Command line invocation:
/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2022-06-09 13:24:55.506 xcodebuild[56644:2509105] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-06-09 13:24:55.506 xcodebuild[56644:2509105] nil host used in call to allowsAnyHTTPSCertificateForHost:
note: Planning
Create build description
Build description signature: e1b8dadde06b6b8ea66aa98f2d3da780
Build description path: /Users/remyjette/src/test/build/CMakeFiles/3.24.20220608-g52c8cb1/CompilerIdCXX/./XCBuildData/e1b8dadde06b6b8ea66aa98f2d3da780-desc.xcbuild
note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
error: An empty identity is not valid when signing a binary for the product type 'Command-line Tool'. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
** BUILD FAILED **
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
65
2022-06-09 13:24:56.894 xcodebuild[56652:2509168] [MT] DVTSDK: Warning: SDK path collision for path '<DVTFilePath:0x600000c0d6c0:'/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk'>': SDK with name 'macosx13.0' being superseded by SDK with 'macosx13.0'.
Command line invocation:
/Users/remyjette/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2022-06-09 13:24:57.674 xcodebuild[56652:2509187] nil host used in call to allowsSpecificHTTPSCertificateForHost
2022-06-09 13:24:57.674 xcodebuild[56652:2509187] nil host used in call to allowsAnyHTTPSCertificateForHost:
note: Planning
Create build description
Build description signature: 1692481f14204601fc124e14daa602a7
Build description path: /Users/remyjette/src/test/build/CMakeFiles/3.24.20220608-g52c8cb1/CompilerIdCXX/./XCBuildData/1692481f14204601fc124e14daa602a7-desc.xcbuild
note: Build preparation complete
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
error: An empty identity is not valid when signing a binary for the product type 'Command-line Tool'. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
** BUILD FAILED **
Note that this even occurs if I try to pass -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
, -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE
, and -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
on the command line.
Edited by Brad King