From f01e2c82f236b405b95adbe517a3cc9b41d17f16 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 29 May 2018 19:31:12 -0700 Subject: Provide some information for building on iOS. --- docs/BUILD_IOS.adoc | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/BUILD_IOS.adoc diff --git a/docs/BUILD_IOS.adoc b/docs/BUILD_IOS.adoc new file mode 100644 index 00000000..573daf50 --- /dev/null +++ b/docs/BUILD_IOS.adoc @@ -0,0 +1,46 @@ += Building for iOS (and tvOS, watchOS) + +NOTE: I am not an iOS developer, so this work is not fully tested. +It seems to work, but YMMV! + +First, you will need to download a suitable toolchain file. + +At the time of this writing (May 28, 2018), the toolchain file +located at https://github.com/leetal/ios-cmake is appears to work +reasonably well. + +When building for iOS and similar targets, only static libraries may be built. +(This is good for avoiding dependency nightmares anyway.) + +Using the above toolchain file, we can build for iOS using +the CMake standard CMAKE_TOOLCHAIN_FILE macro, and using +the IOS_PLATFORM macro to set the target. + +We also need to disable tests and tools, since we can't build command line +executables for that environment. These are controlled by setting +NNG_TESTS and NNG_TOOLS both to OFF. + +You will also need to use the Xcode generator. + +So, for example: + +[source, sh] +---- +% mkdir ios-build +% cd ios-build +% cmake -G Xcode \ + -DCMAKE_TOOLCHAIN_FILE=$GITROOT/ios-cmake/ios.toolchain.cmake \ + -DIOS_PLATFORM=OS \ + -DNNG_TESTS=OFF \ + -DNNG_TOOLS=OFF .. +---- + +Then you can build using Xcode, or simply use cmake to drive the build: + +[source, sh] +---- +% cmake --build . +---- + +Extra effort may be required to enable the use of mbedTLS (NNG does not +at the time of writing support Secure Transport. See issue #497 for status.) -- cgit v1.2.3-70-g09d2