BUILD NOTES
static site checker
https://ssc.lu/
(c) 2020-2022 Dylan Harris


Introduction
============
SSC can be built from various unii using CMake, or with Visual Studios
2017 / 2019 / 2022 under Windows. I have built & tested it under x64 in
selected OSs.


Libraries
=========

Common dependencies
-------------------
You should install boost version 1.75 or better (https://boost.org), a recent
version of the ICU libraries (https://icu-project.org/), & Microsoft's GSL
library (https://github.com/Microsoft/GSL). Most unii have most available as
packages. You can install build and install them yourself if you prefer.

You may need to set these environment variables:
- BOOST: if you're not using your operating system's packaged flavour of boost,
  then set BOOST to your boost source root directory (CMake may welcome
  BOOST_LIBRARYDIR & BOOST_INCLUDEDIR being set appropriately);
- ICU_ROOT: similarly, if you're not using your operating system's packaged
  ICU, set ICU_ROOT to your ICU library source root directory;
- GSL: set it to your GSL root directory.

hunspell
--------
Building SSC under unii, including macos, requires a development installation
of hunspell (https://hunspell.github.io/). You may need to set these
environment variables:
- HUNSPELL_INCLUDE to point to the hunspell include directory
- HUNSPELL_LIB to point to the hunspell library directory
- HUNSPELL_VERSION, the actual library name (such as "hunspell-1.7.so")

Once you've got them, navigate to recipe/tea, and run cmake.

winspell
--------
The Windows build, by default, uses the native Windows spellchecker, although,
in multilingual contexts, that doesn't work so well, unless you use Windows 11.


Building
========

Windows
-------
To build from Visual Studio, navigate to recipe/tea, open the appropriate .sln
file, then build. Only Visual Studios 2017 / 2019 / 2022, 64 bit, have been
built & tested, for Windows 8.1 & 10.

Unii & mock Unii
----------------
You will need CMake 3.12 or better. From the home ssc directory, compile a
normal release build thus:
cd recipe/tea
cmake .
make
ctest
make install

For a debug build:
cd recipe/tea
cmake -DCMAKE_BUILD_TYPE=Debug .
make
ctest
make install

If everything works correctly, then everything will be built, a series of
tests run, with a final result at the very end saying no failures. Having said
that, given SSC is pre-alpha, don't be too surprised to see some warnings or
some final test errors. Note in particular that complaints about being unable
to find or copy files during testing are not of concern, these come from
scripts that set up or tear down individual tests, and the standard commands
used sometimes complain if they can't find files they're supposed to delete,
which is a bit silly given things are already in the desired state.

The following have been successfully built as x64 amd/intel, although not
always under all versions of ssc:
Linux: Centos 8/9 Streams, Ubuntu Server 20.04/20.10
OpenBSD: 7.0 / 6.9 / 6.8
MacOS: Monterey, Big Sur, Catalina, Mojave, High Sierra

Note: Use clang if possible, gcc takes a wee while.


Linux
-----
CMake is poor at spotting rather obvious things such as standard boost library
distributions under Linux, and doesn't even know which flavour of Linux it's
running on, so ssc's CMake configuration presumes that, under Linux, you've
built your own boost.


OpenBSD
-------
I've only tested the amd64 build under 7.0 and 6.9 (and, with older versions
of ssc, 6.8).

The versions of boost and cmake supplied in packages work.

You will need to increase significantly the available memory setting in
login.conf for the build account, if you have not done so already.

Openbsd 6.8 offers hunspell 1.6, so if you use that version, you will need to
set the HUNSPELL_VERSION environment variable appropriately.
