Discussion:
[capnproto] Compiling Capnp on iOS 10.3
Yacine Alami
2017-11-21 18:56:13 UTC
Permalink
Hi guys,

I'm currently working on an iOS app that would require the integration of
capnp.
I'm used to use CMake to cross compile c++ libraries for iOS using an iOS
toolchain.
However, for Capnp I'm stuck on some errors and not even able to generate
the Xcode project to compile it using the command line.

I'm trying to cross compile capnp as a static lib that I can link and call
into my iOS app using an Obj-c++ wrapper to be able to call it from SWIFT.

I use this toolchain (https://github.com/cristeab/ios-cmake) and CMake 9.3,
I'm on high Sierra 10.13.1 and the lastest Xcode 9.1.
I'm targeting iOS 10.3 not 11 yet.

Anyone ever managed to compile it on iOS ? Any help would be greatly
appreciated!

To give more insight of my problems those are the errors that I get :

CMake Error at c++/src/kj/CMakeLists.txt:63 (target_compile_features):
target_compile_features no known features for CXX compiler

"Clang"

version 9.0.0.9000038.

CMake Error at c++/src/capnp/CMakeLists.txt:182 (install):
install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
target "capnp_tool".


I did include the right c++11 flags for iOS (-stdlib=libc++) and add some
Apple specific Cmake instruction.

I use AppleClang 9.0.0.9000038 to compile it.


Thanks a lot for your time guys!


Yacine
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Philip
2017-11-23 20:24:20 UTC
Permalink
Hi Yacine,

There are a couple of iOS toolchains for CMake (I've used
https://github.com/leetal/ios-cmake in the past), but none of them
work particularly well with CMake projects that want to check compiler
features – they either select the wrong compiler, or build the feature
test for the wrong platform.

In this case, you can remove the offending "target_compile_features"
line to hack around the toolchain issue. I've also had similarly-hacky
success with generating an Xcode project for macOS and using Xcode to
change the toolchain.

Philip
Post by Yacine Alami
Hi guys,
I'm currently working on an iOS app that would require the integration of
capnp.
I'm used to use CMake to cross compile c++ libraries for iOS using an iOS
toolchain.
However, for Capnp I'm stuck on some errors and not even able to generate
the Xcode project to compile it using the command line.
I'm trying to cross compile capnp as a static lib that I can link and call
into my iOS app using an Obj-c++ wrapper to be able to call it from SWIFT.
I use this toolchain (https://github.com/cristeab/ios-cmake) and CMake 9.3,
I'm on high Sierra 10.13.1 and the lastest Xcode 9.1.
I'm targeting iOS 10.3 not 11 yet.
Anyone ever managed to compile it on iOS ? Any help would be greatly
appreciated!
target_compile_features no known features for CXX compiler
"Clang"
version 9.0.0.9000038.
install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
target "capnp_tool".
I did include the right c++11 flags for iOS (-stdlib=libc++) and add some
Apple specific Cmake instruction.
I use AppleClang 9.0.0.9000038 to compile it.
Thanks a lot for your time guys!
Yacine
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/capnproto.
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Yacine Alami
2017-11-27 17:43:14 UTC
Permalink
Hi Philip,

Thanks for the answer, I will try the hacky way on commenting out the
"target_compile_feature", though I'm afraid it might 'corrupt' the
generated library, not sure yet.
I'll try the xcode solution too.

Do you know if there is any plan to officially support iOS soon, or will we
be hacking the compilation all the time ?

Thanks!
Post by Philip
Hi Yacine,
There are a couple of iOS toolchains for CMake (I've used
https://github.com/leetal/ios-cmake in the past), but none of them
work particularly well with CMake projects that want to check compiler
features – they either select the wrong compiler, or build the feature
test for the wrong platform.
In this case, you can remove the offending "target_compile_features"
line to hack around the toolchain issue. I've also had similarly-hacky
success with generating an Xcode project for macOS and using Xcode to
change the toolchain.
Philip
Post by Yacine Alami
Hi guys,
I'm currently working on an iOS app that would require the integration
of
Post by Yacine Alami
capnp.
I'm used to use CMake to cross compile c++ libraries for iOS using an
iOS
Post by Yacine Alami
toolchain.
However, for Capnp I'm stuck on some errors and not even able to
generate
Post by Yacine Alami
the Xcode project to compile it using the command line.
I'm trying to cross compile capnp as a static lib that I can link and
call
Post by Yacine Alami
into my iOS app using an Obj-c++ wrapper to be able to call it from
SWIFT.
Post by Yacine Alami
I use this toolchain (https://github.com/cristeab/ios-cmake) and CMake
9.3,
Post by Yacine Alami
I'm on high Sierra 10.13.1 and the lastest Xcode 9.1.
I'm targeting iOS 10.3 not 11 yet.
Anyone ever managed to compile it on iOS ? Any help would be greatly
appreciated!
target_compile_features no known features for CXX compiler
"Clang"
version 9.0.0.9000038.
install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
target "capnp_tool".
I did include the right c++11 flags for iOS (-stdlib=libc++) and add
some
Post by Yacine Alami
Apple specific Cmake instruction.
I use AppleClang 9.0.0.9000038 to compile it.
Thanks a lot for your time guys!
Yacine
--
You received this message because you are subscribed to the Google
Groups
Post by Yacine Alami
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Yacine Alami
Visit this group at https://groups.google.com/group/capnproto.
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Philip
2017-11-28 04:17:16 UTC
Permalink
Unfortunately, I believe these are bugs with the toolchain and not Cap'n Proto.

This commit explains why "target_compile_features" is used:
https://github.com/capnproto/capnproto/commit/1d0d1c3bf56af2935cb229a882ea5c604b1a5f4a

It may be possible to replace target_compile_features with another
test as a workaround, but the real fix is for the toolchain to support
compiler feature detection.

Philip
Post by Yacine Alami
Hi Philip,
Thanks for the answer, I will try the hacky way on commenting out the
"target_compile_feature", though I'm afraid it might 'corrupt' the generated
library, not sure yet.
I'll try the xcode solution too.
Do you know if there is any plan to officially support iOS soon, or will we
be hacking the compilation all the time ?
Thanks!
Post by Philip
Hi Yacine,
There are a couple of iOS toolchains for CMake (I've used
https://github.com/leetal/ios-cmake in the past), but none of them
work particularly well with CMake projects that want to check compiler
features – they either select the wrong compiler, or build the feature
test for the wrong platform.
In this case, you can remove the offending "target_compile_features"
line to hack around the toolchain issue. I've also had similarly-hacky
success with generating an Xcode project for macOS and using Xcode to
change the toolchain.
Philip
Post by Yacine Alami
Hi guys,
I'm currently working on an iOS app that would require the integration of
capnp.
I'm used to use CMake to cross compile c++ libraries for iOS using an iOS
toolchain.
However, for Capnp I'm stuck on some errors and not even able to generate
the Xcode project to compile it using the command line.
I'm trying to cross compile capnp as a static lib that I can link and call
into my iOS app using an Obj-c++ wrapper to be able to call it from SWIFT.
I use this toolchain (https://github.com/cristeab/ios-cmake) and CMake 9.3,
I'm on high Sierra 10.13.1 and the lastest Xcode 9.1.
I'm targeting iOS 10.3 not 11 yet.
Anyone ever managed to compile it on iOS ? Any help would be greatly
appreciated!
target_compile_features no known features for CXX compiler
"Clang"
version 9.0.0.9000038.
install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
target "capnp_tool".
I did include the right c++11 flags for iOS (-stdlib=libc++) and add some
Apple specific Cmake instruction.
I use AppleClang 9.0.0.9000038 to compile it.
Thanks a lot for your time guys!
Yacine
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/capnproto.
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/capnproto.
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+***@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
Loading...