You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+92-41
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,14 @@ Build and/or simply download the Boost C++ Libraries for the Android platform, w
4
4
The [Boost C++ Libraries](http://www.boost.org/), are possibly *the* most popular and generally useful c++ libraries. It would be nice to be able to use them when developing (native c++ or hybrid java/c++ with Google's [Ndk](https://developer.android.com/ndk/)) apps and/or libraries for Android devices.
5
5
The Boost libraries are written to be cross platform, and are available in source code format. However, building the libraries for a given target platform like Android can be very difficult and time consuming. (In particular, building **arm64_v8a** shared libraries that an application can actually load). This project aims to lower the barrier by offering a simple customizable build script you can use to build Boost for Android (abstracting away all the details of the underlying custom boost build system, and target architecture differences), and even providing standard prebuilt binaries to get you started fast.
6
6
7
-
Tested with **Boost 1.83.0** and **Google's Ndk 26b** (LTS).
7
+
Tested with **Boost 1.87.0** and **Google's Ndk 27c** (LTS).
8
8
9
-
You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via [docker](https://www.docker.com) (or of course virtual machines and wsl). _No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (theyre cross compiled *for* android and have no memory of *where* they were built_).
9
+
You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via [docker](https://www.docker.com) (or of course virtual machines and wsl). _No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (they're cross compiled *for* android and have no memory of *where* they were built_).
10
10
11
11
12
12
Creates binaries for multiple abis (**armeabi-v7a**, **arm64-v8a**, **x86**, **x86_64**).
13
13
14
14
15
-
Tested on a development machine running **Ubuntu 20.04** and **MacOS 11.6.5**
16
-
17
15
## Prebuilt
18
16
You can just download a current set of standard prebuilt binaries [here](https://github.com/dec1/Boost-for-Android/releases) if you don't need to customize the build, or don't have access to a unix-like development machine.
* Modify the paths (where the ndk is) and variables (which abis you want to build for) in _do.sh_ as you wish, and execute
41
+
-`cd Boost-for-Android`
42
+
-`./do.sh`
47
43
44
+
If the build succeeded, then the boost binaries should now be in **`./build/install`**
48
45
49
-
* Modify the paths (where the ndk is) and variables (which abis you want to build for) in *do.sh*, and execute it. If the build succeeds then the boost binaries should then be available in the dir *boost_for_android/build*
50
-
Note: If you download the ndk directly do *not* extract it with [Ark](https://apps.kde.org/de/ark). It produces a corrupt extraction, that results in strange compiler errors. (use unzip instead)
46
+
Warning: If you download the ndk directly do *not* extract it with [Ark](https://apps.kde.org/de/ark). It produces a corrupt extraction, that results in strange compiler errors. (use unzip instead)
51
47
```
52
48
> cd boost_for_android
53
49
> ./do.sh
@@ -63,7 +59,7 @@ Note: If you download the ndk directly do *not* extract it with [Ark](https://ap
63
59
Also included is a [test app](./example_app/) which can be opened by Android Studio. If you build and run this app it should show the date and time as calculated by boost *chrono* (indicating that you have built, linked to and called the boost library correctly), as well as the ndk version used to build the boost library.
64
60
To use the test app make sure to adjust the values in the [local.properties](./example_app/local.properties) file.
65
61
66
-
*Note:* The test app uses [CMake for Android](https://developer.android.com/ndk/guides/cmake)
62
+
*Note:* The test app uses [CMake for Android](https://developer.android.com/ndk/guides/cmake) and [Kotlin](https://developer.android.com/kotlin)
67
63
68
64
69
65
## *Header-only* Boost Libraries
@@ -74,53 +70,108 @@ want to use these. To see which of the libraries do require building you can swi
74
70
> ./bootstrap.sh --show-libraries
75
71
```
76
72
77
-
which for example with boost 1.83.0 produces the output:
73
+
which for example with boost 1.87.0 produces the output:
78
74
79
75
```
80
76
The following Boost libraries have portions that require a separate build
81
77
and installation step. Any library not listed here can be used by including
82
78
the headers only.
83
79
84
80
The Boost libraries requiring separate building and installation are:
85
-
- atomic
86
-
- chrono
87
-
- container
88
-
- context
89
81
- contract
90
-
- coroutine
91
82
- date_time
92
83
- exception
93
-
- fiber
94
-
- filesystem
95
84
- graph
96
85
- graph_parallel
97
86
- headers
98
-
- iostreams
99
-
- json
100
87
- locale
101
88
- log
102
-
- math
103
-
- mpi
104
89
- nowide
105
90
- program_options
106
-
- python
107
-
- random
108
91
- regex
109
92
- serialization
110
-
- stacktrace
111
-
- system
112
93
- test
113
94
- thread
114
-
- timer
115
95
- type_erasure
116
-
- url
96
+
- winapi
117
97
- wave
98
+
- variant2
99
+
- variant
100
+
- uuid
101
+
- url
102
+
- unordered
103
+
- type_index
104
+
- tuple
105
+
- timer
106
+
- throw_exception
107
+
- system
108
+
- stl_interfaces
109
+
- stacktrace
110
+
- smart_ptr
111
+
- signals2
112
+
- scope
113
+
- redis
114
+
- ratio
115
+
- random
116
+
- python
117
+
- process
118
+
- predef
119
+
- poly_collection
120
+
- pfr
121
+
- parameter
122
+
- outcome
123
+
- optional
124
+
- mysql
125
+
- multi_index
126
+
- msm
127
+
- mpi
128
+
- mp11
129
+
- move
130
+
- math
131
+
- lockfree
132
+
- lexical_cast
133
+
- lambda2
134
+
- json
135
+
- iterator
136
+
- iostreams
137
+
- intrusive
138
+
- interprocess
139
+
- integer
140
+
- heap
141
+
- hana
142
+
- geometry
143
+
- function_types
144
+
- function
145
+
- flyweight
146
+
- filesystem
147
+
- fiber
148
+
- endian
149
+
- dll
150
+
- detail
151
+
- describe
152
+
- crc
153
+
- coroutine2
154
+
- coroutine
155
+
- core
156
+
- conversion
157
+
- context
158
+
- container_hash
159
+
- container
160
+
- compat
161
+
- cobalt
162
+
- chrono
163
+
- charconv
164
+
- bind
165
+
- bimap
166
+
- beast
167
+
- atomic
168
+
- assert
169
+
- asio
170
+
- any
118
171
119
172
```
120
-
## Crystax
121
-
[Crystax](https://www.crystax.net/) is an alternative to Google's Ndk. It ships with prebuilt boost binaries, and dedicated build scripts.
122
-
These binaries will however not work with Goolge's Ndk. If for some reason you can't or don't want to use Crystax then you can't use their boost binaries or build scripts, which is why this project exists.
173
+
123
174
124
175
## Contributions
125
-
- Many thanks to [crystax](https://github.com/crystax/android-platform-ndk/tree/master/build/tools) for their version of *build-boost.sh* which I adapted to make it work with the google ndk.
176
+
- Many thanks to [crystax](https://github.com/crystax/android-platform-ndk/tree/master/build/tools) for their version of _build-boost.sh which I adapted to make it work with the google ndk.
0 commit comments