aboutsummaryrefslogtreecommitdiff
path: root/docs/BUILD_IOS.adoc
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-29 19:31:12 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-29 19:31:12 -0700
commitf01e2c82f236b405b95adbe517a3cc9b41d17f16 (patch)
treef8dbe6c2bb22c2ba1aecf729c00be92df0a5d7b2 /docs/BUILD_IOS.adoc
parent0ddaee41ec753805fa12eeabd679870802528dac (diff)
downloadnng-f01e2c82f236b405b95adbe517a3cc9b41d17f16.tar.gz
nng-f01e2c82f236b405b95adbe517a3cc9b41d17f16.tar.bz2
nng-f01e2c82f236b405b95adbe517a3cc9b41d17f16.zip
Provide some information for building on iOS.
Diffstat (limited to 'docs/BUILD_IOS.adoc')
-rw-r--r--docs/BUILD_IOS.adoc46
1 files changed, 46 insertions, 0 deletions
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.)