ExternalProject fails compiler test for iOS System Name
The iOS support added with #17870 (closed) fails to work with ExternalProject
:
cmake -GXcode -DCMAKE_SYSTEM_NAME=iOS ..
cmake_minimum_required(VERSION 3.14)
file(MAKE_DIRECTORY external)
file(WRITE external/CMakeLists.txt [=[
cmake_minimum_required(VERSION 3.14)
project(testcase C CXX)
]=])
project(testcase NONE)
include(ExternalProject)
ExternalProject_Add(secretsauce URL ${CMAKE_CURRENT_SOURCE_DIR}/external)
It fails with the following message:
cd /Users/gregorj/src/cmake-issue-17870-1/_build/secretsauce-prefix/src/secretsauce-build && /Users/gregorj/src/cmake/_build/bin/cmake -GXcode /Users/gregorj/src/cmake-issue-17870-1/_build/secretsauce-prefix/src/secretsauce
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
CMake Error at /Users/gregorj/src/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/gregorj/src/cmake-issue-17870-1/_build/secretsauce-prefix/src/secretsauce-build/CMakeFiles/CMakeTmp
Run Build Command(s):/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_2a4eb -configuration Debug -hideShellScriptEnvironment
User defaults from command line:
HideShellScriptEnvironment = YES
Build settings from command line:
TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault
Prepare build
note: Using legacy build system
=== BUILD TARGET cmTC_2a4eb OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION Debug ===
Check dependencies
target specifies product type 'com.apple.product-type.tool', but there's no such product type for the 'iphoneos' platform
** BUILD FAILED **
CC: @alexis-girault
Edited by Gregor Jasny