Skip to content
/ lithium Public
forked from matt-42/lithium

A set of C++17 libraries for high performance network programming

License

Notifications You must be signed in to change notification settings

Woazim/lithium

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Lithium C++ Libraries Travis Donate

========================

Lithium's goal is to ease the development of C++ high performance HTTP APIs. As much effort is put into simplifying it's use as in optimizing its performances. According to the TechEmpower benchmark, it is one of the fastest web framework available.

It is a set of independent header only C++ libraries, each one of them can be used independently. Each library solves one problem and can be used separately.

A zero-cost compile time key/value map.

A JSON serializer/deserializer designed for ease of use and performances.

A set of tools to interact with SQL databases.

A http_client built around the libcurl library.

A library that eases the writing of web HTTP APIs.

The root of the lithium project. Used by all other libraries. You probably will not use this library directly but you can check the code if you want to know what is inside the s:: namespace.

Need some help ?

Post a github issue if you need help with Lithium. And there are no dummy questions !

Getting Started (or setting up automatic symbol generation)

The Lithium paradigm relies on compile time symbols (in the s:: namespace) to bring introspection into C++. If you use symbols, you can either declare them manually, or use li_symbol_generator to generate these definitions automatically.

To get li_symbol_generator, you need to compile and install lithium locally:

git clone https://github.com/matt-42/lithium.git
cd lithium;
mkdir build; cd build;
# Global install:
cmake ..; make -j4 install;
# Local install (replace $HOME/local with your prefered location)
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local; make -j4 install;

You should be able to run li_symbol_generator without arguments and get its help message:

$ li_symbol_generator
=================== Lithium symbol generator ===================

Usage: li_symbol_generator input_cpp_file1, ..., input_cpp_fileN
   Output on stdout the definitions of all the symbols used in the input files.

Usage: li_symbol_generator project_root
   For each folder under project root write a symbols.hh file containing the
   declarations of all symbols used in C++ source and header of this same directory.

If you use cmake, here is a custom target that will run the generator before each compilation.

# the symbol generation target
add_custom_target(
    symbols_generation
    COMMAND li_symbol_generator ${CMAKE_CURRENT_SOURCE_DIR})

# Your executables
add_executable(your_executable your_main.cc)
# Link the symbol generation to your cmake target:
add_dependencies(your_executable symbols_generation)

Now that you have setup symbol generation (or choose manual declaration), you are done because Lithium is header only. You can #include lithium headers and start coding.

Installation / Supported compilers

You can either use the single header version of the libraries (does not provide the li_symbol_generator utility): https://github.com/matt-42/lithium/tree/master/single_headers

Or install the lithium project:

git clone https://github.com/matt-42/lithium.git
cd lithium;
mkdir build; cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=_your_prefix_; make -j4 install;

Supported compilers:

- Linux: G++ 9.2, Clang++ 9.0
- Macos: Clang 11 (everything except http_backend that relies on epoll)
- Not supported anymore: Windows: MSVC 19

Support the project

If you find this project helpful, buy me a coffee! https://www.paypal.me/matthieugarrigues

About

A set of C++17 libraries for high performance network programming

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.9%
  • CMake 1.5%
  • Other 0.6%