diff --git a/src/site/markdown/crosscomp.md b/src/site/markdown/crosscomp.md index 85361a7b7..b6f93c59c 100644 --- a/src/site/markdown/crosscomp.md +++ b/src/site/markdown/crosscomp.md @@ -137,3 +137,7 @@ the JNI code as follows: Right now, crossclang only supports C and C++. However, adding support other languages should be relatively straightforward. + +## See also + +[Developing with Xcode](xcode.html). \ No newline at end of file diff --git a/src/site/markdown/development.md b/src/site/markdown/development.md index c851334a3..f842ac461 100644 --- a/src/site/markdown/development.md +++ b/src/site/markdown/development.md @@ -9,6 +9,8 @@ Here are some instructions to get started. * [Developing with Eclipse](eclipse.html) + * [Developing with Xcode](xcode.html) + * [Custom architectures: Building and running](customarch.html) * [Cross-compiling junixsocket](crosscomp.html) diff --git a/src/site/markdown/xcode.md b/src/site/markdown/xcode.md new file mode 100644 index 000000000..d11d7fe22 --- /dev/null +++ b/src/site/markdown/xcode.md @@ -0,0 +1,35 @@ +# Developing with Xcode + +The recommended editor for working with the native C code is Xcode. Even for non-Apple targets. + +This works thanks to crossclang, also see [Cross-compiling junixsocket](crosscomp.html). + +## Setup + +In order to develop with Xcode, using crossclang, you need to install a custom Xcode SDK. + +Run the following script from the Terminal, which creates a symbolic link under +`~/Library/Developer/Toolchains` to the `crossclang.sdk`, which essentially tells Xcode to use +our "crossclang" clang wrapper script instead of its built-in version, among other things. + + ./junixsocket-native/crossclang/Xcode-Support/install + +You then need to: + +1. Restart Xcode +2. Set the Toolchain to "crossclang" (via Xcode -> Toolchains..., or via a button in the launch window) +3. Open junixsocket-native.xcodeproj +4. Run "Clean Build Folder" +5. Run "Build" + +Note that you need to switch back to the default Xcode Toolchain when you develop other projects. + +## Building from the command-line + +AFter installing the "crossclang" Toolchain, you can also build from the command-line. +In this case, you don't have to switch the Toolchain via Xcode: + + xcodebuild -project junixsocket-native/junixsocket-native.xcodeproj -configuration Release \ + -target "All Architectures" -toolchain crossclang USE_HEADERMAP=NO \ + CURRENT_ARCH=undefined_arch arch=undefined_arch ARCHS=arm64 CODE_SIGNING_ALLOWED=NO \ + clean build