From 0caa990a933909d6a4da73feb383129d9eea12d0 Mon Sep 17 00:00:00 2001 From: pupbrained Date: Fri, 18 Oct 2024 16:07:02 -0400 Subject: [PATCH] im ngl im too tired to figure out why this isnt working rn --- .envrc | 1 - flake.nix | 36 ++++++++++++++++++++++-------------- meson.build | 18 +++++++++--------- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.envrc b/.envrc index 391e83a..c4b17d7 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1 @@ -PATH_add ./shaders use_flake diff --git a/flake.nix b/flake.nix index 7661eb2..fd747ff 100644 --- a/flake.nix +++ b/flake.nix @@ -45,18 +45,24 @@ IMGUI_BUILD_VULKAN_BINDING = true; }; - deps = with pkgs; [ - fmt - glfw - glm - imgui - shaderc - vulkan-extension-layer - vulkan-memory-allocator - vulkan-utility-libraries - vulkan-loader - vulkan-tools - ]; + deps = with pkgs; + [ + fmt + glfw + glm + glslang + imgui + vulkan-extension-layer + vulkan-memory-allocator + vulkan-utility-libraries + vulkan-loader + vulkan-tools + ] + ++ (with pkgsStatic; [ + spirv-tools + spirv-cross + spirv-headers + ]); in with pkgs; rec { packages = rec { @@ -102,11 +108,12 @@ }; }; - devShell = mkShell.override {inherit stdenv;} { - packages = + devShell = mkShell.override {inherit stdenv;} rec { + buildInputs = [ alejandra bear + cmake (llvmPackages_18.clang-tools.override {enableLibcxx = true;}) lldb meson @@ -123,6 +130,7 @@ ] ++ deps; + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; VULKAN_SDK = "${vulkan-headers}"; VK_LAYER_PATH = "${vulkan-validation-layers}/share/vulkan/explicit_layer.d"; VK_ICD_FILENAMES = diff --git a/meson.build b/meson.build index 5779833..78a93d9 100644 --- a/meson.build +++ b/meson.build @@ -31,16 +31,16 @@ deps = [ dependency('vulkan', include_type: 'system'), ] -glslang_dep = cpp.find_library('glslang', required: false) - -if not glslang_dep.found() - glslang_dep = dependency('glslang', required: true, include_type: 'system') -endif - -spirv_dep = cpp.find_library('SPIRV', required: false) +spirv_dep = dependency('SPIRV-Tools', required: false, include_type: 'system') if not spirv_dep.found() - spirv_dep = dependency('SPIRV', required: true, include_type: 'system') + spirv_dep = cpp.find_library('SPIRV-Tools', required: true) +endif + +glslang_dep = dependency('glslang', required: false, include_type: 'system') + +if not glslang_dep.found() + glslang_dep = cpp.find_library('glslang', required: true) endif imgui_dep = dependency('imgui', required: false, include_type: 'system') @@ -56,4 +56,4 @@ executable( sources: files('src/main.cpp'), include_directories: include_directories('include', is_system: true), dependencies: deps, -) \ No newline at end of file +)