Setup the basic main function
This commit is contained in:
parent
a829c30424
commit
1ffdf050e4
|
@ -19,7 +19,13 @@ set(iwyu_path ${iwyu})
|
||||||
|
|
||||||
find_program(lld NAMES lld REQUIRED)
|
find_program(lld NAMES lld REQUIRED)
|
||||||
|
|
||||||
add_executable(feynman)
|
|
||||||
|
find_package(argparse REQUIRED)
|
||||||
|
find_package(fmt REQUIRED)
|
||||||
|
find_package(RocksDB REQUIRED)
|
||||||
|
|
||||||
|
add_executable(feynman
|
||||||
|
)
|
||||||
|
|
||||||
set_target_properties(feynman PROPERTIES
|
set_target_properties(feynman PROPERTIES
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
|
@ -39,15 +45,24 @@ target_include_directories(feynman
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/janet
|
${CMAKE_CURRENT_SOURCE_DIR}/src/janet
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
add_dependencies(feynman
|
||||||
|
argparse::argparse
|
||||||
|
fmt::fmt
|
||||||
|
RocksDB::rocksdb
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(feynman SYSTEM PUBLIC
|
target_include_directories(feynman SYSTEM PUBLIC
|
||||||
# We don't want the generated files from table gen
|
# We don't want the generated files from table gen
|
||||||
# to be treated as local since the contain warnings
|
# to be treated as local since the contain warnings
|
||||||
${PROJECT_BINARY_DIR}/include)
|
${PROJECT_BINARY_DIR}/feynman/include
|
||||||
|
|
||||||
|
)
|
||||||
# target_link_libraries(feynman PRIVATE
|
target_link_libraries(feynman PRIVATE
|
||||||
|
argparse::argparse
|
||||||
# )
|
fmt::fmt
|
||||||
|
RocksDB::rocksdb
|
||||||
|
)
|
||||||
|
|
||||||
# Autogenerate the `config.h` file
|
# Autogenerate the `config.h` file
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in include/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in include/config.h)
|
||||||
|
|
|
@ -19,8 +19,15 @@
|
||||||
#include <argparse/argparse.hpp> // for ArgumentParser
|
#include <argparse/argparse.hpp> // for ArgumentParser
|
||||||
#include <memory> // for allocator
|
#include <memory> // for allocator
|
||||||
|
|
||||||
//int argc, char *argv[]
|
#include "config.h"
|
||||||
int main() {
|
|
||||||
argparse::ArgumentParser program("git-journal");
|
int main(int argc, char *argv[]) {
|
||||||
|
argparse::ArgumentParser program("feynman", FEYNMAN_VERSION);
|
||||||
|
|
||||||
|
program.add_argument("-f");
|
||||||
|
|
||||||
|
program.parse_args(argc, argv);
|
||||||
|
|
||||||
|
std::cout << program << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
16
flake.nix
16
flake.nix
|
@ -131,6 +131,8 @@
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nativePkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
pkgs = get_pkgs overlays;
|
pkgs = get_pkgs overlays;
|
||||||
# Just disabling the tests that fails under musl
|
# Just disabling the tests that fails under musl
|
||||||
git' = pkgs.git.overrideAttrs (old: {
|
git' = pkgs.git.overrideAttrs (old: {
|
||||||
|
@ -157,9 +159,10 @@
|
||||||
valgrind
|
valgrind
|
||||||
gtest
|
gtest
|
||||||
bashInteractive
|
bashInteractive
|
||||||
|
nativePkgs.fish
|
||||||
]);
|
]);
|
||||||
|
|
||||||
deps = (with pkgs; [
|
deps = (with pkgs.pkgsStatic; [
|
||||||
fmt
|
fmt
|
||||||
rocksdb
|
rocksdb
|
||||||
gtest
|
gtest
|
||||||
|
@ -172,11 +175,20 @@
|
||||||
build
|
build
|
||||||
run
|
run
|
||||||
compile
|
compile
|
||||||
|
blah
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
shell = args: (pkgs.mkShell.override { inherit stdenv; }) {
|
shell = args: (pkgs.mkShell.override { inherit stdenv; }) {
|
||||||
nativeBuildInputs = buildToolsDeps ++ devCommands;
|
name = "feynman";
|
||||||
|
nativeBuildInputs = buildToolsDeps ++ devCommands ++ deps;
|
||||||
buildInputs = deps;
|
buildInputs = deps;
|
||||||
|
|
||||||
|
|
||||||
|
CPP_LS = "clangd -j 30 --query-driver=${pkgs.clang_17}/bin/clang++-*";
|
||||||
|
shellHook = ''
|
||||||
|
fish && exit
|
||||||
|
'';
|
||||||
} // args;
|
} // args;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
{ deps, writeShellApplication, cmake, ninja, ...}:
|
{ deps, writeShellApplication, cmake, ninja, clang_17, ...}:
|
||||||
let
|
let
|
||||||
compile = writeShellApplication {
|
compile = writeShellApplication {
|
||||||
name = "compile";
|
name = "compile";
|
||||||
|
@ -42,6 +42,7 @@ let
|
||||||
${compile}/bin/compile "$@"
|
${compile}/bin/compile "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
inherit compile run build;
|
inherit compile run build blah;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue