mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 04:44:20 +00:00
Mitigate issues related to compiler options when cross-compiling (#21330)
* Document C compiler options config when cross-compiling * Allow empty string to override default
This commit is contained in:
@@ -316,14 +316,16 @@ Another way is to make Nim invoke a cross compiler toolchain:
|
||||
nim c --cpu:arm --os:linux myproject.nim
|
||||
```
|
||||
|
||||
For cross compilation, the compiler invokes a C compiler named
|
||||
like `$cpu.$os.$cc` (for example arm.linux.gcc) and the configuration
|
||||
system is used to provide meaningful defaults. For example for `ARM` your
|
||||
For cross compilation, the compiler invokes a C compiler named like
|
||||
`$cpu.$os.$cc` (for example `arm.linux.gcc`) with options defined in
|
||||
`$cpu.$os.$cc.options.always`. The configuration system is used to provide
|
||||
meaningful defaults. For example, for Linux on a 32-bit ARM CPU, your
|
||||
configuration file should contain something like:
|
||||
|
||||
arm.linux.gcc.path = "/usr/bin"
|
||||
arm.linux.gcc.exe = "arm-linux-gcc"
|
||||
arm.linux.gcc.linkerexe = "arm-linux-gcc"
|
||||
arm.linux.gcc.options.always = "-w -fmax-errors=3"
|
||||
|
||||
Cross-compilation for Windows
|
||||
=============================
|
||||
|
||||
Reference in New Issue
Block a user