Cross Compiling: Difference between revisions
imported>Mic92 add workshop link |
imported>Symphorien add an example shell file |
||
Line 11: | Line 11: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
== How to obtain a shell with a cross compiler == | |||
Create a file as follows: | |||
{{file|crossShell.nix|nix|<nowiki> | |||
with import <nixpkgs> { | |||
crossSystem = { | |||
config = "aarch64-unknown-linux-gnu"; | |||
}; | |||
}; | |||
mkShell { | |||
buildInputs = [ zlib ]; # your dependencies here | |||
} | |||
</nowiki>}} | |||
and then use it to obtain a shell: | |||
{{commands|nix-shell crossShell.nix}} | |||
The resulting shell will have <code>$CC</code> etc. set to the right compiler. | |||
== How to specify dependencies == | == How to specify dependencies == |