mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-06 18:54:12 +00:00
Merge pull request #3093 from avanspector/master
Add shell environment for Nix
This commit is contained in:
27
default.nix
27
default.nix
@@ -1,27 +0,0 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
let
|
||||
odin-unwrapped = pkgs.llvmPackages_11.stdenv.mkDerivation (rec {
|
||||
name = "odin-unwrapped";
|
||||
src = ./.;
|
||||
dontConfigure = true;
|
||||
nativeBuildInputs = [ pkgs.git ];
|
||||
buildPhase = ''
|
||||
make debug SHELL=${pkgs.llvmPackages_11.stdenv.shell}
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp odin $out/bin/odin
|
||||
cp -r core $out/bin/core
|
||||
'';
|
||||
});
|
||||
path = builtins.map (path: path + "/bin") (with pkgs.llvmPackages_11; [
|
||||
bintools
|
||||
llvm
|
||||
clang
|
||||
lld
|
||||
]);
|
||||
in
|
||||
pkgs.writeScriptBin "odin" ''
|
||||
#!${pkgs.llvmPackages_11.stdenv.shell}
|
||||
PATH="${(builtins.concatStringsSep ":" path)}" exec ${odin-unwrapped}/bin/odin $@
|
||||
''
|
||||
11
shell.nix
Normal file
11
shell.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
pkgs.mkShell {
|
||||
name = "odin";
|
||||
nativeBuildInputs = with pkgs; [
|
||||
git
|
||||
clang_17
|
||||
llvmPackages_17.llvm
|
||||
llvmPackages_17.bintools
|
||||
];
|
||||
shellHook="CXX=clang++";
|
||||
}
|
||||
@@ -448,7 +448,7 @@ typedef i32 b32; // NOTE(bill): Prefer this!!!
|
||||
#define gb_inline __forceinline
|
||||
#endif
|
||||
#else
|
||||
#define gb_inline __attribute__ ((__always_inline__))
|
||||
#define gb_inline inline __attribute__ ((__always_inline__))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user