diff --git a/.gitignore b/.gitignore index 4f518cb..2e80806 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ # Added by cargo /target +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ed5e17d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f694ac8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "License Managment tool"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: { + packages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: import ./nix { + inherit system inputs; + pkgs = nixpkgs.legacyPackages.${system}; + }); + }; +} diff --git a/meson.build b/meson.build index f3994b3..957fb89 100644 --- a/meson.build +++ b/meson.build @@ -1,35 +1,7 @@ project( 'lf2', - 'c', - 'cpp', - meson_version: '>=0.58.0', - default_options: [ - 'cpp_std=c++20', - 'warning_level=2', - ], + 'cpp' ) -cppc = meson.get_compiler('cpp') +subdir('native') -prefix = get_option('prefix') -data_dir = get_option('datadir') -lib_dir = get_option('libdir') - -add_project_arguments(cppc.get_supported_arguments([ - '-Wno-unused-parameter', - '-Wno-missing-field-initializers', - '-Wno-c99-designator', - '-Wno-invalid-offsetof', - '-Wno-unused-const-variable', - '-Wno-volatile', # glm warning - '-Wno-deprecated-volatile', -]), language: 'cpp') - -add_project_arguments(cppc.get_supported_arguments([ - '-ffast-math', -]), language: 'cpp') - -sqlite3_dep = dependency('sqlite3') -vulkan_dep = dependency('vulkan') - -subdir('src') diff --git a/native/main.cpp b/native/main.cpp new file mode 100644 index 0000000..7867d62 --- /dev/null +++ b/native/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello World!"; + return 0; +} diff --git a/native/meson.build b/native/meson.build new file mode 100644 index 0000000..9364a6b --- /dev/null +++ b/native/meson.build @@ -0,0 +1,5 @@ +executable( + 'license-tool', + 'main.cpp', + install: true, +) diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..b30fa70 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,5 @@ +{ system, pkgs, inputs }: + +{ + native = pkgs.callPackage ./native.nix {}; +} diff --git a/nix/native.nix b/nix/native.nix new file mode 100644 index 0000000..cf696c7 --- /dev/null +++ b/nix/native.nix @@ -0,0 +1,20 @@ +{ + lib, + stdenv, + meson, + ninja, +}: + +stdenv.mkDerivation { + pname = "native"; + version = "0.1"; + + src = ../.; + + nativeBuildInputs = [ meson ninja ]; + + meta = { + maintainers = with lib.maintainers; [ jopejoe1 ]; + platforms = lib.platforms.all; + }; +}