diff --git a/.envrc b/.envrc index ae39e78..c4b17d7 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1 @@ -export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 -use_flake . --impure +use_flake diff --git a/flake.nix b/flake.nix index 296203f..de0fb47 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ stdenv = if pkgs.hostPlatform.isLinux - then pkgs.stdenvAdapters.useMoldLinker pkgs.llvmPackages_18.stdenv + then pkgs.stdenvAdapters.useMoldLinker pkgs.llvmPackages_18.libcxxStdenv else pkgs.llvmPackages_18.stdenv; sources = import ./_sources/generated.nix { @@ -34,19 +34,17 @@ fmt = mkPkg "fmt"; - deps = with pkgs; - [ - fmt - glfw - glm - vulkan-tools - ] - ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - darwin.apple_sdk.frameworks.Cocoa - darwin.apple_sdk.frameworks.Metal - darwin.apple_sdk.frameworks.QuartzCore - ]; + deps = with pkgs; [ + fmt + glfw + glm + vulkan-extension-layer + vulkan-memory-allocator + vulkan-utility-libraries + vulkan-headers + vulkan-loader + vulkan-tools + ]; in with pkgs; rec { packages = rec { @@ -88,7 +86,7 @@ clang-format = { enable = true; - package = pkgs.clang-tools_18; + package = pkgs.llvmPackages_18.clang-tools; }; }; }; @@ -98,7 +96,7 @@ [ alejandra bear - llvmPackages_18.clang-tools + (llvmPackages_18.clang-tools.override {enableLibcxx = true;}) lldb meson ninja @@ -113,13 +111,8 @@ ] ++ deps; - shellHook = lib.optionals stdenv.isDarwin '' - export MOLTENVK_LIBRARY_PATH="${darwin.moltenvk}/lib" - export PATH="${llvmPackages_18.clang-tools}/bin:$PATH" - export VK_ICD_FILENAMES="${darwin.moltenvk}/share/vulkan/icd.d/MoltenVK_icd.json" - export VK_LAYER_PATH="${vulkan-validation-layers}/share/vulkan/explicit_layer.d" - export VULKAN_INCLUDE_DIRS="${darwin.moltenvk.dev}/include:${vulkan-headers}/include" - export VK_LOADER_DEBUG=all + shellHook = '' + export PATH="${llvmPackages_18.clang-tools.override {enableLibcxx = true;}}/bin:$PATH" ''; name = "C++"; diff --git a/meson.build b/meson.build index 56b0b91..b1dbb4c 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,7 @@ project( default_options: [ 'cpp_std=c++20', 'warning_level=everything', + 'buildtype=debugoptimized' ], ) @@ -23,11 +24,9 @@ common_cpp_args = [ '-Wno-unsafe-buffer-usage', '-Wunused-function', '-fvisibility=hidden', - '-stdlib=libc++' ] add_project_arguments(cpp.get_supported_arguments(common_cpp_args), language: 'cpp') -add_project_arguments('-stdlib=libc++', language: 'cpp') source_file_names = [ 'src/main.cpp',