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
use_flake . --impure

View file

@ -20,7 +20,7 @@
stdenv = stdenv =
if pkgs.hostPlatform.isLinux 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; else pkgs.llvmPackages_18.stdenv;
sources = import ./_sources/generated.nix { sources = import ./_sources/generated.nix {
@ -34,18 +34,16 @@
fmt = mkPkg "fmt"; fmt = mkPkg "fmt";
deps = with pkgs; deps = with pkgs; [
[
fmt fmt
glfw glfw
glm glm
vulkan-extension-layer
vulkan-memory-allocator
vulkan-utility-libraries
vulkan-headers
vulkan-loader
vulkan-tools 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 in
with pkgs; rec { with pkgs; rec {
@ -88,7 +86,7 @@
clang-format = { clang-format = {
enable = true; enable = true;
package = pkgs.clang-tools_18; package = pkgs.llvmPackages_18.clang-tools;
}; };
}; };
}; };
@ -98,7 +96,7 @@
[ [
alejandra alejandra
bear bear
llvmPackages_18.clang-tools (llvmPackages_18.clang-tools.override {enableLibcxx = true;})
lldb lldb
meson meson
ninja ninja
@ -113,13 +111,8 @@
] ]
++ deps; ++ deps;
shellHook = lib.optionals stdenv.isDarwin '' shellHook = ''
export MOLTENVK_LIBRARY_PATH="${darwin.moltenvk}/lib" export PATH="${llvmPackages_18.clang-tools.override {enableLibcxx = true;}}/bin:$PATH"
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
''; '';
name = "C++"; name = "C++";

View file

@ -5,6 +5,7 @@ project(
default_options: [ default_options: [
'cpp_std=c++20', 'cpp_std=c++20',
'warning_level=everything', 'warning_level=everything',
'buildtype=debugoptimized'
], ],
) )
@ -23,11 +24,9 @@ common_cpp_args = [
'-Wno-unsafe-buffer-usage', '-Wno-unsafe-buffer-usage',
'-Wunused-function', '-Wunused-function',
'-fvisibility=hidden', '-fvisibility=hidden',
'-stdlib=libc++'
] ]
add_project_arguments(cpp.get_supported_arguments(common_cpp_args), language: 'cpp') add_project_arguments(cpp.get_supported_arguments(common_cpp_args), language: 'cpp')
add_project_arguments('-stdlib=libc++', language: 'cpp')
source_file_names = [ source_file_names = [
'src/main.cpp', 'src/main.cpp',