diff --git a/CMakeLists.txt b/CMakeLists.txt index 0699e16..6a28b4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.org b/README.org index 2c1d464..bf84313 100644 --- a/README.org +++ b/README.org @@ -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 diff --git a/default.nix b/default.nix index 83b1569..ac131bd 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,13 @@ with (import {}); -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"; } diff --git a/main.cpp b/main.cpp index 3b27157..8ec9f09 100644 --- a/main.cpp +++ b/main.cpp @@ -1,17 +1,6 @@ -#include -#include #include -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; }