Skip to content

docs: update documentation to show how to use CMake #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,21 @@ libdispatch for /usr/lib/system on OS X El Capitan:
Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with
clang and blocks support:

sh autogen.sh
./configure CC=clang --with-blocks-runtime=/usr/local/lib
make check
```
cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DWITH_BLOCKS_RUNTIME=/usr/local/lib <path-to-source>
ninja
ninja test
```

### Building for android

Note that this assumes that you are building on Linux. It requires that you
have the android NDK available. It has been tested against API Level 21.

```
cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 -DCMAKE_ANDROID_NDK=<path to android NDK> <path-to-source>
ninja
```

### Building and installing for Linux

Expand All @@ -140,19 +152,19 @@ on Ubuntu; currently supported versions are 14.04, 15.10 and 16.04.

1. The first thing to do is install required packages:

`sudo apt-get install autoconf libtool pkg-config clang systemtap-sdt-dev libbsd-dev linux-libc-dev`
`sudo apt-get install cmake ninja-build clang systemtap-sdt-dev libbsd-dev linux-libc-dev`

Note: compiling libdispatch requires clang 3.8 or better and
the gold linker. If the default clang on your Ubuntu version is
too old, see http://apt.llvm.org/ to install a newer version.
On older Ubuntu releases, you may need to install binutils-gold
to get the gold linker.

2. Build (as in the general instructions above)
2. Build

```
sh autogen.sh
./configure
make
make install
cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ <path-to-source>
ninja
ninja install
```