localPackages.sbatch-cli: init

This commit is contained in:
2024-06-08 18:37:36 +08:00
parent c2d54a2b73
commit 9e81d5a64f
7 changed files with 40 additions and 0 deletions

View File

@@ -197,6 +197,12 @@
packages = [ pkgs.clang-tools_17 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
sbatch-cli = pkgs.mkShell
{
packages = with pkgs; [ sbatch-cli ];
buildInputs = [ pkgs.clang-tools_17 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
};
}

View File

@@ -78,6 +78,7 @@ inputs: rec
sqlite-orm = inputs.pkgs.callPackage ./sqlite-orm { src = inputs.topInputs.sqlite-orm; };
mkPnpmPackage = inputs.pkgs.callPackage ./mkPnpmPackage.nix {};
nodejs-with-pnpm9 = inputs.pkgs.callPackage ./nodejs-with-pnpm9.nix {};
sbatch-cli = inputs.pkgs.callPackage ./sbatch-cli {};
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}

View File

@@ -0,0 +1,3 @@
CompileFlags:
Add: [ -Wall, -Wextra, -std=c++23 ]
Compiler: g++

View File

@@ -0,0 +1 @@
use flake .#sbatch-cli

View File

@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.14)
project(sbatch-cli VERSION 0.0.0 LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(HPCSTAT_VERSION "unknown" CACHE STRING "Version of the hpcstat")
add_executable(sbatch-cli src/main.cpp)
target_compile_features(sbatch-cli PUBLIC cxx_std_23)
# target_link_libraries(sbatch-cli PRIVATE)
install(TARGETS sbatch-cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")

View File

@@ -0,0 +1,7 @@
{ stdenv, cmake, pkg-config }: stdenv.mkDerivation
{
name = "sbatch-cli";
src = ./.;
buildInputs = [];
nativeBuildInputs = [ cmake pkg-config ];
}

View File