chore: create package for nix

This commit is contained in:
xinyangli 2024-07-22 17:30:02 +08:00
parent 5228b6117d
commit 4d41ff63eb
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
4 changed files with 22 additions and 0 deletions

View file

@ -4,5 +4,7 @@ project(difftest)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD 17)
include(GNUInstallDirs)
include_directories(include) include_directories(include)
add_subdirectory(src) add_subdirectory(src)

17
default.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib
, stdenv
, cmake
, mini-gdbstub
, cli11
}: stdenv.mkDerivation {
pname = "diffu";
version = "0.0.0";
src = ./.;
nativeBuildInputs = [
cmake
mini-gdbstub
cli11
];
}

View file

@ -49,6 +49,7 @@
mini-gdbstub mini-gdbstub
]; ];
}; };
packages.default = pkgs.callPackage ./default.nix { };
} }
); );
} }

View file

@ -1,2 +1,4 @@
add_executable(diffu cli.cpp difftest.cpp gdbstub.cpp loader.cpp main.cpp) add_executable(diffu cli.cpp difftest.cpp gdbstub.cpp loader.cpp main.cpp)
target_link_libraries(diffu PRIVATE gdbstub) target_link_libraries(diffu PRIVATE gdbstub)
install ( TARGETS diffu )