Skip to content
Martin Mitáš edited this page Feb 11, 2019 · 8 revisions

Simple Building

Building MD4C from the source repository or source package is based on cmake and there should be no surprises. There are no build dependencies (standard C library suffices).

For example, on Linux:

$ cd md4c
$ mkdir build
$ cd build
$ cmake ..
$ make

This actually builds the md4c library and md2html utility. This utility uses MD4C parser to read a Markdown document and converts it into HTML.

Note the build enables MD4C's UTF-8 support.

Shared vs. Static Library

By default, builds on systems other then Windows, build MD4C as a shared library. That's because this is what most Linux package maintainers likely expect.

In contrast, on Windows, static library is built by default. The reason is that on Windows, there is nothing similar to /usr/lib on Unix-like systems.

Either way, you may explicitly ask for building shared or static library with Cmake option BUILD_SHARED_LIBS):

$ cmake -DBUILD_SHARED_LIBS=ON  path/to/project_root  # to enforce building shared library
$ cmake -DBUILD_SHARED_LIBS=OFF path/to/project_root  # to enforce building static library

Build Configurations

Build configuration is determined by the standard cmake's CMAKE_BUILD_TYPE variable. By default (when not specified), MD4C builds a Release build.

Please note that Debug build may result in a binary which is about two times slower then the Release build.