Git Product home page Git Product logo

Comments (34)

joeced avatar joeced commented on July 18, 2024 4

I think I have found a solution, adding

set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM <10 Letter Dev. Team ID>)

Solves the code signing issue. If one can find the Developer Team ID automatically it would be very nice.

from polly.

reasonMix avatar reasonMix commented on July 18, 2024 2

@gelldur use xcode to create a simple project for ios,and the bundle id is com.example, and check the auto option,then xcode will auto download the provisioning profiles, when compile success, close xcode ,then use the polly to build your's project

from polly.

 avatar commented on July 18, 2024 1

Awesome, works like a charm :-) thanks guys !

from polly.

headupinclouds avatar headupinclouds commented on July 18, 2024 1

For reference: http://stackoverflow.com/a/18727947

from polly.

joeced avatar joeced commented on July 18, 2024 1

I use Xcode 8.0 and iOS 10.1 SDK, and it works fine for me.

from polly.

ruslo avatar ruslo commented on July 18, 2024

@joeced Thanks for the info. I have not installed Xcode 8 yet. Will take a look later.

from polly.

joeced avatar joeced commented on July 18, 2024

@ruslo Great. If you have any ideas on either finding Developer Team ID automatically or "just" use a variable to define, I'll be happy to make a pull request.

from polly.

reasonMix avatar reasonMix commented on July 18, 2024

@joeced there is a stupid method, i modify the ios-10-0.cmake,and add the following lines:
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
to ignore the compile the simple c program

from polly.

ruslo avatar ruslo commented on July 18, 2024

i modify the ios-10-0.cmake,and add the following lines

Just for your info this will break Hunter builds: https://github.com/ruslo/hunter/wiki/error.abi.detection.failure

from polly.

headupinclouds avatar headupinclouds commented on July 18, 2024

Per @joeced, adding the CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM variable to the toolchain fixes the issue. What convention shall we use for polly toolchains? Environment variable?

if (NOT DEFINED ENV{XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}) 
  polly_fatal_error("XCODE_ATTRIBUTE_DEVELOPMENT_TEAM variable must be set.")
endif()

set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example)
set(CMAKE_MACOSX_BUNDLE YES)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "$ENV{XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}")

from polly.

joeced avatar joeced commented on July 18, 2024

@headupinclouds I think that looks like a nice solution, and matches the pattern use in other toolchain files.

from polly.

ruslo avatar ruslo commented on July 18, 2024

If one can find the Developer Team ID automatically it would be very nice

Can't find anything :(

I think that looks like a nice solution, and matches the pattern use in other toolchain files

Yes, seems like an appropriate solution. Implemented in master:

Documentation:

from polly.

headupinclouds avatar headupinclouds commented on July 18, 2024

Thanks!

from polly.

joeced avatar joeced commented on July 18, 2024

Great! Thanks.

from polly.

gelldur avatar gelldur commented on July 18, 2024

Error still occurs?

- [polly] Used toolchain: iOS 10.1 Universal (iphoneos + iphonesimulator) / clang / c++11 support
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- 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.7.0/share/cmake/Modules/CMakeTestCCompiler.cmake:51 (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/gelldur/Projects/app/CMakeFiles/CMakeTmp

  

  Run Build Command:"/usr/bin/xcodebuild" "-project"
  "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_f876e"
  "-configuration" "Debug"

  === BUILD TARGET cmTC_f876e OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
  Debug ===

  

  Check dependencies

  No profiles for 'com.example' were found: Xcode couldn't find a
  provisioning profile matching 'com.example'.

  Code signing is required for product type 'Application' in SDK 'iOS 10.1'

  

  ** 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:2 (PROJECT)

from polly.

ruslo avatar ruslo commented on July 18, 2024

@gelldur are you sure everything okay with your provisioning profiles? Can you try to start Xcode and build/run trivial example on your device? (without CMake and without Polly)

from polly.

gelldur avatar gelldur commented on July 18, 2024

@ruslo the same with example
Xcode sample project building normally. When i use ios-nocodesign-10-1.cmake everything ok

from polly.

ruslo avatar ruslo commented on July 18, 2024

@gelldur what is the version of Polly you're using? Probably you need to update: git pull?

from polly.

gelldur avatar gelldur commented on July 18, 2024

@ruslo yesterday i downloaded master

from polly.

ruslo avatar ruslo commented on July 18, 2024

@gelldur can you show the minimal example to reproduce the problem? Does error occur for this one:

cmake_minimum_required(VERSION 3.7)
project(foo)

?

from polly.

gelldur avatar gelldur commented on July 18, 2024

CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED (VERSION 3.7)

PROJECT (test)

ADD_EXECUTABLE(Test main.cpp)

I used: cmake -DCMAKE_TOOLCHAIN_FILE=~/Desktop/polly/ios-10-1.cmake -G Xcode .. without toolchain it works but this isn't what we want :(

-- Edit
Also when i'm building for simulator it doesn't work :/ simply during linking no such dir: /proj/ios/Debug-iphonesimulator/libmylib.a

from polly.

ruslo avatar ruslo commented on July 18, 2024

@gelldur test is not a good name for project/target. Just to be sure try another names.

from polly.

ruslo avatar ruslo commented on July 18, 2024

then xcode will auto download the provisioning profiles

@reasonMix Already checked as far as I understand

@gelldur I can reproduce similar error by providing incorrect team-id. Can you verify that team-id is correct? Here is the guide:

Also I haven't updated Xcode yet, just for your information I'm using Xcode 8.0 and iOS 10.0 SDK.

from polly.

gelldur avatar gelldur commented on July 18, 2024

I have changed CMakeLists.txt:

CMAKE_MINIMUM_REQUIRED (VERSION 3.7)
PROJECT (foo)
ADD_EXECUTABLE(Foo main.cpp)

I have checked my team id twice.


After creating Example project with com.example test script pass :) thx @reasonMix !
So now i am able to run cmake with toolchain.

Currently i have only problem with not found static libs. Simply build dirs are empty. I figure it out that using cocoapods workspace (after pod install) breaks it. So i simply go back to use oryginal xcodeproj now everything is building correctly but only in DEBUG when i deploy on iPhone or Simulator

But when i archive errors occur :( because missing libs in release dirs

from polly.

ruslo avatar ruslo commented on July 18, 2024

After creating Example project with com.example test script pass :)

Added by Polly here:

But when i archive errors occur :( because missing libs in release dirs

Please open separate issue if the problem is not about team-id. And if the problem is about Polly of course :)

from polly.

gelldur avatar gelldur commented on July 18, 2024

Ok now everything ok. Important note is that project MUST BE created next to top level CMakeLists to prevent such bugs... also i reset to default build paths for all submodules. Thx for help!

from polly.

ruslo avatar ruslo commented on July 18, 2024

Important note is that project MUST BE created next to top level CMakeLists to prevent such bugs

What do you mean? Your top level CMakeLists.txt doesn't contain project command?

Ok now everything ok

@gelldur Can you summarize what was the problem exactly and the solution? This may be helpful for other developers. This info can be saved to Errors section: http://polly.readthedocs.io/en/latest/toolchains/ios.html#errors

from polly.

gelldur avatar gelldur commented on July 18, 2024

Normally when you create project simply you do:

mkdir build
cd build
cmake ..

In my case when i do it in this way i have a lot of errors. Ok maybe not errors but sometimes subprojects do not build etc.

i just must execute cmake . and now installing pods etc works correctly.

My top level CMakeLists.txt contains project. On linux / android everything is working correctly

from polly.

ruslo avatar ruslo commented on July 18, 2024

cmake ..

@gelldur You mean cmake -DCMAKE_TOOLCHAIN_FILE=/.../ios.cmake -GXcode .. right?

cmake .

In source build?

On linux / android everything is working correctly

Probably issue is masked by some factor on such platforms but on iOS it triggers real errors.

from polly.

gelldur avatar gelldur commented on July 18, 2024

yeah cmake.. was only shortcut ;) for whole command.

I have such order:

CMakeLists <-- i must make project next to this file
native
|___ CMakeLists
|___ src
proj
|___ ios
|      |___ src
|      |___ CMakeLists
|___ android
|      |___ src
|      |___ CMakeLists
|___ linux
|      |___ src
|      |___ CMakeLists

from polly.

ruslo avatar ruslo commented on July 18, 2024

In my case when i do it in this way i have a lot of errors

It would be much easier if you provide an example and what kind of errors you get. Also this doesn't seems like a Polly related issue, just some cmake related troubles in CMakeLists.txt.

from polly.

headupinclouds avatar headupinclouds commented on July 18, 2024

use xcode to create a simple project for ios,and the bundle id is com.example, and check the auto option,then xcode will auto download the provisioning profiles, when compile success, close xcode ,then use the polly to build your's project

This post ☝️ from @reasonMix helped me get through an error on a new OS X + Xcode 8 installation. It seems the process of creating a project "manually" has some side-effect that is required for CMake builds to work. ENV = { Xcode 8.2, OS X 10.12.2; Cmake = 3.7.2 }.

from polly.

ruslo avatar ruslo commented on July 18, 2024

@headupinclouds Okay, saved to documentation:

@reasonMix thanks for sharing

from polly.

ruslo avatar ruslo commented on July 18, 2024

Step by step document with screenshots:

from polly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.