This commit is contained in:
Mars 2024-09-28 13:00:48 -04:00
parent 95eafb2432
commit 3b3cb5bec3
3 changed files with 18 additions and 27 deletions

3
.envrc
View file

@ -1,2 +1 @@
export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
use_flake . --impure
use_flake

View file

@ -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,18 +34,16 @@
fmt = mkPkg "fmt";
deps = with pkgs;
[
deps = with pkgs; [
fmt
glfw
glm
vulkan-extension-layer
vulkan-memory-allocator
vulkan-utility-libraries
vulkan-headers
vulkan-loader
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
];
in
with pkgs; 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++";

View file

@ -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',