Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

simdjson/cmakedemo

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple demo of simdjson as a CMake dependency.

This repository is meant to serve as an example of how to use simdjson as a CMake dependency by having simdjson as a git submodule. It is not the most efficient approach, read on for faster approaches.

Usage:

mkdir build && cd build && cmake .. && cmake --build . && ./src/test

The simple CMake project builds a simple parser (./src/test) which can parse a given JSON document (provided as a command-line parameter) and determine whether it is valid JSON.

Please refer to the main simdjson project for further documentation.

How to add simdjson as a CMake dependency

Fundamentally, it is as simple as adding the following line after copying the project as a subdirectory in your own project:

add_subdirectory(simdjson EXCLUDE_FROM_ALL)

Why and how to add a submodule?

If your own project is under git, you probably do not want to copy simdjson in your own git repository. Instead, you want to add it as a submodule.

Once you have a git repository, adding simdjson as a submodule is relatively easy, type:

git submodule add https://github.com/simdjson/simdjson.git

Using submodules, you can control exactly which version your colleagues are using, down to the commit. Furthermore, submodules are portable: they work wherever git works.

Then you can just follow our example.

FetchContent

We can also do a demo using a single CMakeLists.txt file.

ExternalProject

Users who prefer to use CMake's ExternalProject approach may refer to our example.

About

Simple example on how to use simdjson with CMake using a git submodule

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.