FINALLY get clangd working

This commit is contained in:
Curt Spark 2025-11-20 02:21:17 +00:00
parent 98c071d7ee
commit 53b9bb2d72
4 changed files with 13 additions and 23 deletions

View File

@ -5,10 +5,8 @@ project(discern)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#string(REPLACE ":" ";" INCLUDE_LIST $ENV{CMAKE_LIBRARY_PATH})
#include_directories(${INCLUDE_LIST})
#string(REPLACE ":" ";" INCLUDE_LIST $ENV{CMAKE_STDLIB})
#include_directories($ENV{CMAKE_STDLIB})
add_executable(discern)

View File

@ -1,4 +1,2 @@
* NixOS C++ Dev Template
Due to issues with clangd, switched to cc-ls.
Also now a basic CMake template.
* Nix C++ Dev Template
Basic C++ CMake template with Nix

View File

@ -1,8 +1,13 @@
with (import <nixpkgs> {});
pkgs.mkShell {
name = "C++ Study Repository";
buildInputs = with pkgs; [
clangStdenv.mkDerivation {
name = "discern";
nativeBuildInputs = with pkgs; [
cmake
clang-tools
clang
];
CXXFLAGS = "-isystem${pkgs.gcc.cc}/include/c++/14.3.0 -isystem${pkgs.gcc.cc}/include/c++/14.3.0/x86_64-unknown-linux-gnu -isystem${pkgs.glibc.dev}/include";
}

View File

@ -1,17 +1,6 @@
#include <print>
#include <string>
#include <iostream>
typedef struct foo {
uint8_t test;
int one() {
return 1;
};
} foo;
int main() {
foo ok;
std::cout << std::to_string(ok.one()) << std::endl;
std::cout << "Hello, world!" << std::endl;
}