aboutsummaryrefslogtreecommitdiff
path: root/BUILDING.md
blob: 50ca3ea6ee79209b6d96d4eedc4ae3013d93a9b4 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## Requirements

### [Qt](https://www.qt.io/) 5.11

Even though most of the browser might work with the last LTS Qt release, always
use an up-to-date version of QtWebEngine. Security fixes to Blink do _not_ get
backported. QtWebEngine can be built with older versions of Qt, if upgrading Qt
is not a possibility.

### [boost](http://www.boost.org/) program_options

### cmake 3.10

### Compiler with C++17 support
 - gcc 7+;  clang 4+
 - Windows: only MSVC is supported due to QtWebEngine

## Basic Installation
In short, the generic cmake build loop of 'cmake, make, make install' will
generate a makefile, build the program and install it.

~~~ sh
# clone the repository
hg clone https://neueland.iserlohn-fortress.net/smolbote.hg

# generate makefile
mkdir build && cd build
cmake -DCMAKE_CXX_FLAGS="-O2 [other cxx flags]" -DCMAKE_BUILD_TYPE=Release ../smolbote.hg

# make && make install
make -j4
make install
~~~

### -DCMAKE_CXX_FLAGS
cmake does not set any C++ flags by default, including no optimization flags.
You need to set these yourself if your build system doesn't set any either.

On gcc/clang, no optimize flags are set by default, resulting in rather bloated
code being generated. Recommend setting at least -O2. MSVC has optimze flags
set by default.

### -DCMAKE_BUILD_TYPE
Install paths are only set on Release builds.

### -DCMAKE_INSTALL_PREFIX
Sets the install location prefix.
win32: Binary is written to bin/, and plugins to bin/plugins.
others: Binary will be written to bin/, and plugins to lib/smolbote/.

### Using libc++
You can use libc++ over stdlibc++ by setting UseLibCpp to On. Requires clang.

~~~ sh
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DUseLibCpp=On
~~~

### Verifying source code integrity
Since mercurial doesn't have any method for signing commits, some commits have
signed sha512 checksums available.

~~~ sh
# get node for the current commit
node="$(hg log -r tip --template='{node}')"

# get sha512 checksums and signature
curl -O https://neueland.iserlohn-fortress.net/smolbote/integrity/$node
curl -O https://neueland.iserlohn-fortress.net/smolbote/integrity/$node.sig

# verify signature and files
gpg --verify $node.sig
sha512sum --check --quiet $node
~~~