Switch to cmake and cc-ls
This commit is contained in:
parent
d85e4e2bdc
commit
aba50e7300
|
|
@ -1,2 +1,3 @@
|
||||||
|
build/
|
||||||
.cache/
|
.cache/
|
||||||
a.out
|
.ccls-cache/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
cmake_minimum_required(VERSION 3.23)
|
||||||
|
|
||||||
|
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})
|
||||||
|
|
||||||
|
|
||||||
|
add_executable(discern)
|
||||||
|
|
||||||
|
target_sources(discern
|
||||||
|
PRIVATE
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
"/run/current-system/sw/bin/clang++",
|
|
||||||
"-std=c++23",
|
|
||||||
"-resource-dir",
|
|
||||||
"/nix/store/k2s6xfca52n25yb8b6f58i87kszp3m7g-clang-wrapper-21.1.2/resource-root",
|
|
||||||
"-idirafter",
|
|
||||||
"/nix/store/dqgfdpr53ldqmdfmginb1z6kzslkzsdl-glibc-2.40-66-dev/include",
|
|
||||||
"-isystem",
|
|
||||||
"/nix/store/68ndh04pl2hhhizsarvzwa9cnlp7zj3d-gcc-14.3.0/include/c++/14.3.0",
|
|
||||||
"-isystem",
|
|
||||||
"/nix/store/68ndh04pl2hhhizsarvzwa9cnlp7zj3d-gcc-14.3.0/include/c++/14.3.0/x86_64-unknown-linux-gnu",
|
|
||||||
"-c",
|
|
||||||
"main.cpp"
|
|
||||||
],
|
|
||||||
"directory": "/home/cspark/Projects/CPP/hello_world",
|
|
||||||
"file": "/home/cspark/Projects/CPP/hello_world/main.cpp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
build/compile_commands.json
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
with (import <nixpkgs> {});
|
||||||
|
|
||||||
|
pkgs.mkShell {
|
||||||
|
name = "C++ Study Repository";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
cmake
|
||||||
|
];
|
||||||
|
}
|
||||||
15
main.cpp
15
main.cpp
|
|
@ -1,6 +1,17 @@
|
||||||
#include <iostream>
|
|
||||||
#include <print>
|
#include <print>
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
typedef struct foo {
|
||||||
|
uint8_t test;
|
||||||
|
|
||||||
|
int one() {
|
||||||
|
return 1;
|
||||||
|
};
|
||||||
|
} foo;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
std::println("Hello, world!");
|
foo ok;
|
||||||
|
std::cout << std::to_string(ok.one()) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue