Skip to content

Commit

Permalink
moved cmake-helper down
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-null-undefined committed Nov 15, 2023
1 parent b55ec97 commit 3a34ca2
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
libpng12
zlib
];

cmake-helper = {
libs = builtins.map builtins.toString (builtins.map pkgs.lib.getLib libs);
includes = builtins.map builtins.toString (builtins.map pkgs.lib.getDev libs);
};

program-name = "ascii-art";
in {
apps = {
Expand Down Expand Up @@ -127,13 +121,15 @@
};

formatter = pkgs.alejandra;

cmake-helper = {
inherit (cmake-helper) libs includes;

cmake-helper = let
libs' = builtins.map builtins.toString (builtins.map pkgs.lib.getLib libs);
includes' = builtins.map builtins.toString (builtins.map pkgs.lib.getDev libs);
in {
libs = libs';
includes = includes';
cmake-file = pkgs.writeText "CMakeList.txt" (pkgs.lib.strings.concatLines (
(builtins.map (lib: ''target_link_directories(''${CMAKE_PROJECT_NAME} PUBLIC ${lib}/lib)'') cmake-helper.libs)
++ (builtins.map (include: ''include_directories(${include}/include)'') cmake-helper.includes)
(builtins.map (lib: ''target_link_directories(''${CMAKE_PROJECT_NAME} PUBLIC ${lib}/lib)'') libs')
++ (builtins.map (include: ''include_directories(${include}/include)'') includes')
));
};
});
Expand Down

0 comments on commit 3a34ca2

Please sign in to comment.