FINALLY get clangd working
This commit is contained in:
parent
98c071d7ee
commit
53b9bb2d72
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
|
||||||
|
|
|
||||||
11
default.nix
11
default.nix
|
|
@ -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";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
main.cpp
13
main.cpp
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue