From 99f08e2b6e446e03fa3c7321b58e40ff3796d747 Mon Sep 17 00:00:00 2001 From: Leonardo Vencovsky Date: Wed, 26 Jun 2024 22:50:15 +0200 Subject: [PATCH] Add clangd to project --- .clangd | 2 ++ .gitignore | 2 ++ CMakeLists.txt | 18 ++++++++++++++++++ Makefile | 5 ++++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .clangd create mode 100644 CMakeLists.txt diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..ecba6b4 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + CompilationDatabase: "cmake" diff --git a/.gitignore b/.gitignore index 4f1b4d1..73574fc 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,5 @@ build tests/coverage tests/out + +cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ce3f6a2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) + +project(cmc) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +file(GLOB_RECURSE sources + "./tests/main.c" +) + +add_definitions(-DCMC_CALLBACKS) + +add_executable(cmc ${sources}) + +target_include_directories(cmc PUBLIC + "./" +) + diff --git a/Makefile b/Makefile index 470b3cb..d2c4e3b 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,10 @@ docserve: mdbook serve documentation install_dev_deps: - sudo apt install gcc make valgrind lcov clang-format hyperfine + sudo apt install gcc make valgrind lcov clang-format hyperfine clangd cmake cargo install mdbook +build_clangd: + cmake -S . -G "Unix Makefiles" -B cmake + .PHONY: tests tests_dev format bench docbuild docserve install_dev_deps