clang: Migrate to `CMake`, dropping `bear`.
parent
d1d383a5a7
commit
4a0f1aa919
|
@ -10,7 +10,7 @@ STAGED=$(
|
||||||
TARGETS=()
|
TARGETS=()
|
||||||
while IFS= read -r FILENAME
|
while IFS= read -r FILENAME
|
||||||
do
|
do
|
||||||
if [[ "$FILENAME" =~ .*\.c$ ]] || [[ "$FILENAME" =~ .*\.h$ ]]; then
|
if [[ "$FILENAME" =~ .*\.c(pp)?$ ]] || [[ "$FILENAME" =~ .*\.h(pp)?$ ]]; then
|
||||||
TARGETS+=("${FILENAME}")
|
TARGETS+=("${FILENAME}")
|
||||||
fi
|
fi
|
||||||
done <<< "$STAGED"
|
done <<< "$STAGED"
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
# Directory used by `direnv` to hold `use flake`-generated profiles.
|
# Directory used by `direnv` to hold `use flake`-generated profiles.
|
||||||
/.direnv/
|
/.direnv/
|
||||||
|
|
||||||
# The compilation database produced by `bear`.
|
|
||||||
/compile_commands.json
|
|
||||||
|
|
||||||
# The directory containing all build outputs.
|
# The directory containing all build outputs.
|
||||||
/dist/
|
/dist/
|
||||||
|
|
||||||
|
@ -15,3 +12,19 @@
|
||||||
|
|
||||||
# A symlink produced by default when running `nix build`.
|
# A symlink produced by default when running `nix build`.
|
||||||
/result
|
/result
|
||||||
|
|
||||||
|
# The default executable built.
|
||||||
|
/a.out
|
||||||
|
|
||||||
|
# Files generated by CMake.
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
cmake_minimum_required(VERSION 3.15)
|
||||||
|
|
||||||
|
project(App VERSION 0.1.0)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
add_executable(a.out main.c)
|
|
@ -15,7 +15,7 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
outputs = { nixpkgs, flake-utils, ... }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
@ -30,8 +30,8 @@
|
||||||
stdenv = pkgs.clangStdenv;
|
stdenv = pkgs.clangStdenv;
|
||||||
} {
|
} {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
bear
|
|
||||||
clang-tools
|
clang-tools
|
||||||
|
cmake
|
||||||
codelldb
|
codelldb
|
||||||
doxygen
|
doxygen
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue