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_CXX_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#string(REPLACE ":" ";" INCLUDE_LIST $ENV{CMAKE_LIBRARY_PATH}) #string(REPLACE ":" ";" INCLUDE_LIST $ENV{CMAKE_STDLIB})
#include_directories($ENV{CMAKE_STDLIB})
#include_directories(${INCLUDE_LIST})
add_executable(discern) add_executable(discern)

View File

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

View File

@ -1,8 +1,13 @@
with (import <nixpkgs> {}); with (import <nixpkgs> {});
pkgs.mkShell { clangStdenv.mkDerivation {
name = "C++ Study Repository"; name = "discern";
buildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
cmake 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> #include <iostream>
typedef struct foo {
uint8_t test;
int one() {
return 1;
};
} foo;
int main() { int main() {
foo ok; std::cout << "Hello, world!" << std::endl;
std::cout << std::to_string(ok.one()) << std::endl;
} }