aboutsummaryrefslogtreecommitdiff
path: root/docs/BUILD_CROSSCOMPILE.adoc
blob: f454726aee4263b9102b7fec0c6df72d0467a4e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ifdef::env-github[]
:note-caption: :information_source:
endif::[]

= Building for Cross Compilation

TIP: Cross-compiling is used when the operating system or process architecture
the software is being built for is different than the system where the software
is being compiled.  If you don't know what this means, this does not apply to
and you should ignore this file.

When building for cross-compilation, you can use CMake's native support
`CMAKE_TOOLCHAIN_FILE` to configure the location of the toolchain.

You'll need that toolchain to have your compiler, linker, header files,
and possibly any other libraries that need to be linked at build time.

This is all relatively standard stuff for CMake.

A lot more detail is located here: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling

NOTE: When _NNG_ detects that it is being built in a Cross-Compile
situation (i.e. when `CMAKE_CROSSCOMPILING` is true), it will default
to disabling the building of the test suite and tools.
This is normally preferable, since many embedded environments cannot host
command line applications or shell environments. +
 +
To enable tools or tests to build anyway, the values of either
`NNG_TOOLS` or `NNG_TESTS` (or both) may be set to `ON`.

== Cross-compiling for Android

More details for Android are located in the <<BUILD_ANDROID.adoc>> file.

== Cross-compiling for iOS

More details for iOS (and tvOS, etc.) are located in the <<BUILD_IOS.adoc>> file.

== Cross-compiling for Windows or Linux or MACOS - Using vcpkg

You can download and install nng using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:

    git clone https://github.com/Microsoft/vcpkg.git
    cd vcpkg
    ./bootstrap-vcpkg.sh
    ./vcpkg integrate install
    ./vcpkg install nng

The nng port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.