Skip to content

Commit ed37616

Browse files
committed
docs: Update the Windows cross-compilation section
1 parent 9bb79c1 commit ed37616

File tree

2 files changed

+107
-10
lines changed

2 files changed

+107
-10
lines changed

INSTALL.md

Lines changed: 104 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,14 @@ Get the toxcore source code and navigate to `other/docker/windows`.
299299
Build the container image based on the Dockerfile. The following options are
300300
available to customize the building of the container image.
301301

302-
| Name | Description | Expected Value | Default Value |
303-
| --------------------- | --------------------------------------------------- | ----------------------------------- | ------------- |
304-
| `SUPPORT_ARCH_i686` | Support building 32-bit toxcore. | "true" or "false" (case sensitive). | true |
305-
| `SUPPORT_ARCH_x86_64` | Support building 64-bit toxcore. | "true" or "false" (case sensitive). | true |
306-
| `SUPPORT_TEST` | Support running toxcore automated tests. | "true" or "false" (case sensitive). | false |
307-
| `CROSS_COMPILE` | Cross-compiling. True for Docker, false for Cygwin. | "true" or "false" (case sensitive). | true |
308-
| `VERSION_OPUS` | Version of libopus to build toxcore with. | Numeric version number. | 1.4 |
309-
| `VERSION_SODIUM` | Version of libsodium to build toxcore with. | Numeric version number. | 1.0.19 |
310-
| `VERSION_VPX` | Version of libvpx to build toxcore with. | Numeric version number. | 1.14.0 |
302+
| Name | Description | Expected Value | Default Value |
303+
| --------------------- | ------------------------------------------- | ----------------------------------- | ------------- |
304+
| `SUPPORT_ARCH_i686` | Support building 32-bit toxcore. | "true" or "false" (case sensitive). | true |
305+
| `SUPPORT_ARCH_x86_64` | Support building 64-bit toxcore. | "true" or "false" (case sensitive). | true |
306+
| `SUPPORT_TEST` | Support running toxcore automated tests. | "true" or "false" (case sensitive). | false |
307+
| `VERSION_OPUS` | Version of libopus to build toxcore with. | Numeric version number. | 1.4 |
308+
| `VERSION_SODIUM` | Version of libsodium to build toxcore with. | Numeric version number. | 1.0.19 |
309+
| `VERSION_VPX` | Version of libvpx to build toxcore with. | Numeric version number. | 1.14.0 |
311310

312311
Example of building a container image with options
313312

@@ -329,7 +328,6 @@ customize the running of the container image.
329328
| `ENABLE_ARCH_x86_64` | Build 64-bit toxcore. The image should have been built with `SUPPORT_ARCH_x86_64` enabled. | "true" or "false" (case sensitive). | `true` |
330329
| `ENABLE_TEST` | Run the test suite. The image should have been built with `SUPPORT_TEST` enabled. | "true" or "false" (case sensitive). | `false` |
331330
| `EXTRA_CMAKE_FLAGS` | Extra arguments to pass to the CMake command when building toxcore. | CMake options. | `-DTEST_TIMEOUT_SECONDS=90` |
332-
| `CROSS_COMPILE` | Cross-compiling. True for Docker, false for Cygwin. | "true" or "false" (case sensitive). | `true` |
333331

334332
Example of running the container with options
335333

@@ -339,13 +337,109 @@ docker run \
339337
-e ALLOW_TEST_FAILURE=true \
340338
-v /path/to/toxcore/sourcecode:/toxcore \
341339
-v /path/to/where/output/build/result:/prefix \
340+
-t \
342341
--rm \
343342
toxcore
344343
```
345344

346345
After the build succeeds, you should see the built toxcore libraries in
347346
`/path/to/where/output/build/result`.
348347

348+
The file structure should look similar to the following
349+
350+
```
351+
result
352+
├── [4.0K] i686
353+
│   ├── [ 36K] bin
354+
│   │   ├── [636K] DHT_bootstrap.exe
355+
│   │   ├── [572K] cracker.exe
356+
│   │   ├── [359K] cracker_simple.exe
357+
│   │   ├── [378K] create_bootstrap_keys.exe
358+
│   │   ├── [378K] create_minimal_savedata.exe
359+
│   │   ├── [958K] create_savedata.exe
360+
│   │   ├── [ 18K] libtoxcore.def
361+
│   │   ├── [2.6M] libtoxcore.dll
362+
│   │   ├── [ 65K] libtoxcore.exp
363+
│   │   ├── [428K] libtoxcore.lib
364+
│   │   ├── [989K] save-generator.exe
365+
│   │   ├── [381K] sign.exe
366+
│   │   └── [408K] strkey.exe
367+
│   ├── [4.0K] include
368+
│   │   └── [4.0K] tox
369+
│   │   ├── [177K] tox.h
370+
│   │   ├── [ 10K] tox_dispatch.h
371+
│   │   ├── [ 26K] tox_events.h
372+
│   │   ├── [6.4K] tox_private.h
373+
│   │   ├── [ 26K] toxav.h
374+
│   │   └── [ 12K] toxencryptsave.h
375+
│   └── [4.0K] lib
376+
│   ├── [577K] libopus.a
377+
│   ├── [660K] libsodium.a
378+
│   ├── [ 10K] libssp.a
379+
│   ├── [1016K] libtoxcore.a
380+
│   ├── [456K] libtoxcore.dll.a
381+
│   ├── [2.7M] libvpx.a
382+
│   ├── [ 72K] libwinpthread.a
383+
│   └── [4.0K] pkgconfig
384+
│   ├── [ 250] libsodium.pc
385+
│   ├── [ 357] opus.pc
386+
│   ├── [ 247] toxcore.pc
387+
│   └── [ 309] vpx.pc
388+
└── [4.0K] x86_64
389+
├── [ 36K] bin
390+
│   ├── [504K] DHT_bootstrap.exe
391+
│   ├── [474K] cracker.exe
392+
│   ├── [277K] cracker_simple.exe
393+
│   ├── [287K] create_bootstrap_keys.exe
394+
│   ├── [288K] create_minimal_savedata.exe
395+
│   ├── [769K] create_savedata.exe
396+
│   ├── [ 18K] libtoxcore.def
397+
│   ├── [2.4M] libtoxcore.dll
398+
│   ├── [ 64K] libtoxcore.exp
399+
│   ├── [420K] libtoxcore.lib
400+
│   ├── [800K] save-generator.exe
401+
│   ├── [289K] sign.exe
402+
│   └── [317K] strkey.exe
403+
├── [4.0K] include
404+
│   └── [4.0K] tox
405+
│   ├── [177K] tox.h
406+
│   ├── [ 10K] tox_dispatch.h
407+
│   ├── [ 26K] tox_events.h
408+
│   ├── [6.4K] tox_private.h
409+
│   ├── [ 26K] toxav.h
410+
│   └── [ 12K] toxencryptsave.h
411+
└── [4.0K] lib
412+
├── [697K] libopus.a
413+
├── [575K] libsodium.a
414+
├── [ 11K] libssp.a
415+
├── [905K] libtoxcore.a
416+
├── [449K] libtoxcore.dll.a
417+
├── [2.9M] libvpx.a
418+
├── [ 68K] libwinpthread.a
419+
└── [4.0K] pkgconfig
420+
├── [ 252] libsodium.pc
421+
├── [ 359] opus.pc
422+
├── [ 249] toxcore.pc
423+
└── [ 311] vpx.pc
424+
425+
12 directories, 60 files
426+
```
427+
428+
- `libtoxcore.dll` is the shared library. It is fully self-contained, with no
429+
additional dependencies aside from the Windows OS dlls, and can be used in
430+
MSVC, MinGW, Clang, etc. projects. Despite its name, it provides toxcore,
431+
toxav, toxencryptsave -- all of Tox.
432+
- `libtoxcore.a` is the static library. In order to use it, it needs to be
433+
linked against the other provided .a libraries (but not the .dll.a!) and
434+
additionally -liphlpapi and -lws2_32 Windows dlls. It similarly provides all
435+
of Tox APIs.
436+
- `libtoxcore.dll.a` is the MinGW import library for `libtoxcore.dll`.
437+
- `libtoxcore.lib` is the MSVC import library for `libtoxcore.dll`.
438+
- `libtoxcore.exp` and `libtoxcore.def` are the exported by `libtoxcore`
439+
symbols.
440+
- `*.exe` are statically compiled executables -- `DHT_bootstrap` and
441+
[the fun utils](#secondary).
442+
349443
## Pre-built binaries
350444

351445
### Linux

other/docker/windows/build_toxcore.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
set -e -x
44

5+
# Note: when modifying this script, don't forget to update the appropriate
6+
# parts of the cross-compilation section of the INSTALL.md.
7+
58
#=== Cross-Compile Toxcore ===
69

710
build() {

0 commit comments

Comments
 (0)