iOS: Xcode framework generation problem
When i generate iOS framework with CMake using Xcode generator (-GXcode), i got error:
-- The C compiler identification is AppleClang 184.108.40.20600033 -- The CXX compiler identification is AppleClang 220.127.116.1100033 -- 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 /usr/local/Cellar/cmake/3.16.2/share/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/paulo/Developer/workspaces/cpp/ezored/build/ios_framework/Debug/ios/armv7/target/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_79730 -configuration Debug -hideShellScriptEnvironment && User defaults from command line: HideShellScriptEnvironment = YES Prepare build note: Using legacy build system === BUILD TARGET cmTC_79730 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 ** The following build commands failed: Check dependencies (1 failure) CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:27 (project)
I made a simple project that is here: https://github.com/prsolucoes/conan-cmake-test
And add an issue with log and all other details: https://github.com/prsolucoes/conan-cmake-test/issues/1
But with a simple CMakeLists.txt and code below make the problem happen:
Im trying create an iOS framework and not a MacOS. The MacOS project was created with "-GXcode" and compiled with success, but iOS get that error. The only problem is with iOS and generator Xcode. Unix Makefile generator works, but the framework generated is different from Apple requirements and rejected when upload.
xcode: 11.3.1 macos: catalina cmake: 3.16.2 (i tried earlier versions too)