summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2018-07-15 14:00:29 +0100
committerGitHub <noreply@github.com>2018-07-15 14:00:29 +0100
commitb625e6115cb3194790bde725fa12ce42a4f9e81a (patch)
tree1feb8ae2f717863e2224d0f04bb2468421e2372b
parent332469692d5053c6c935163e196b117b6979c8e7 (diff)
parentd3c2fb22dbe2831d2b85aa92fd5c86f0eb961c54 (diff)
downloadNim-b625e6115cb3194790bde725fa12ce42a4f9e81a.tar.gz
Merge pull request #8328 from jyapayne/patch-1
Remove cross-compile breaking env var in Nintendo Switch config
-rw-r--r--config/nim.cfg8
-rw-r--r--doc/nimc.rst12
2 files changed, 8 insertions, 12 deletions
diff --git a/config/nim.cfg b/config/nim.cfg
index 626f4494a..c30190a18 100644
--- a/config/nim.cfg
+++ b/config/nim.cfg
@@ -111,10 +111,10 @@ path="$lib/pure"
 
 @if nintendoswitch:
   cc = "switch_gcc"
-  switch_gcc.options.linker = "-g -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE $SWITCH_LIBS"
-  switch_gcc.cpp.options.linker = "-g -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE $SWITCH_LIBS"
-  switch_gcc.options.always = "-g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE $SWITCH_INCLUDES -D__SWITCH__"
-  switch_gcc.cpp.options.always = "-g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE $SWITCH_INCLUDES -D__SWITCH__ -fno-rtti -fno-exceptions -std=gnu++11"
+  switch_gcc.options.linker = "-g -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE"
+  switch_gcc.cpp.options.linker = "-g -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE"
+  switch_gcc.options.always = "-g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -D__SWITCH__"
+  switch_gcc.cpp.options.always = "-g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -D__SWITCH__ -fno-rtti -fno-exceptions -std=gnu++11"
 @end
 
 # Configuration for the Intel C/C++ compiler:
diff --git a/doc/nimc.rst b/doc/nimc.rst
index a3adcc143..0939f67e8 100644
--- a/doc/nimc.rst
+++ b/doc/nimc.rst
@@ -232,12 +232,12 @@ Cross compilation for Nintendo Switch
 =====================================
 
 Simply add --os:nintendoswitch
-to your usual ``nim c`` or ``nim cpp`` command and set the ``SWITCH_LIBS``
-and ``SWITCH_INCLUDES`` environment variables to something like:
+to your usual ``nim c`` or ``nim cpp`` command and set the ``passC``
+and ``passL`` command line switches to something like:
 
 .. code-block:: console
-  export SWITCH_INCLUDES="-I$DEVKITPRO/libnx/include"
-  export SWITCH_LIBS="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
+  nim c ... --passC="-I$DEVKITPRO/libnx/include" ...
+  --passL="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
 
 or setup a nim.cfg file like so:
 
@@ -259,10 +259,6 @@ an nro file with the ``elf2nro`` tool in the DevkitPro release. Examples can be
 `the nim-libnx github repo <https://github.com/jyapayne/nim-libnx.git>`_ or you can use
 `the switch builder tool <https://github.com/jyapayne/switch-builder.git>`_.
 
-Environment variables are: 
-  - ``SWITCH_LIBS`` for any extra libraries required by your application (``-lLIBNAME`` or ``-LLIBPATH``)
-  - ``SWITCH_INCLUDES`` for any extra include files (``-IINCLUDE_PATH``)
-
 There are a few things that don't work because the DevkitPro libraries don't support them.
 They are: