Skip to content

Commit

Permalink
Committed some half-finished stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jan 18, 2020
1 parent e7e1c73 commit 5e06533
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions content/posts/safe-ffi-with-cxx.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ever used it before.
We want to make sure users of our crate don't have to mess around with
dependencies or compiling code themselves, so it's important to write
[a build script][build-script] to this for them. Having a robust and
cross-platform way of building the project is a really important part of this.
cross-platform way of building the project is a really important part of this!

It looks like `cmake` will be our best option. The `autotools` suite isn't
really used much outside of GNU projects on Linux, and it's especially painful
Expand Down Expand Up @@ -193,13 +193,21 @@ $ cmake ..
$ ls
bindings cmake_install.cmake CMakeCache.txt CMakeFiles LibtorrentRasterbar
Makefile torrent-rasterbar-pkgconfig
$ make
$ make -j8
```

`cmake` isn't normally known for its concise output, but at least everything
builds!

{{% notice tip %}}
Something to keep in mind is how long it takes to compile `libtorrent`. On my
laptop (8 cores, 12GB RAM) a full build with 1 core (the default when running
`make`) took so long (28 minutes!) I ended up leaving it running overnight.

In comparison, building with all 8 cores (`make -j8`) only took about 5 minutes.
Hopefully the `cmake` crate is smart enough to enable parallelism where
possible, otherwise our users aren't going to be happy...
{{% /notice %}}



Expand Down

0 comments on commit 5e06533

Please sign in to comment.