implemented a new localPassc pragma (#12706)
This commit is contained in:
parent
c0eeea4f3c
commit
64e8f050e1
7 changed files with 48 additions and 12 deletions
|
|
@ -6560,18 +6560,31 @@ The ``link`` pragma can be used to link an additional file with the project:
|
|||
|
||||
PassC pragma
|
||||
------------
|
||||
The ``passC`` pragma can be used to pass additional parameters to the C
|
||||
compiler like you would using the commandline switch ``--passC``:
|
||||
The ``passc`` pragma can be used to pass additional parameters to the C
|
||||
compiler like you would using the commandline switch ``--passc``:
|
||||
|
||||
.. code-block:: Nim
|
||||
{.passC: "-Wall -Werror".}
|
||||
{.passc: "-Wall -Werror".}
|
||||
|
||||
Note that you can use ``gorge`` from the `system module <system.html>`_ to
|
||||
embed parameters from an external command that will be executed
|
||||
during semantic analysis:
|
||||
|
||||
.. code-block:: Nim
|
||||
{.passC: gorge("pkg-config --cflags sdl").}
|
||||
{.passc: gorge("pkg-config --cflags sdl").}
|
||||
|
||||
|
||||
LocalPassc pragma
|
||||
-----------------
|
||||
The ``localPassc`` pragma can be used to pass additional parameters to the C
|
||||
compiler, but only for the C/C++ file that is produced from the Nim module
|
||||
the pragma resides in:
|
||||
|
||||
.. code-block:: Nim
|
||||
# Module A.nim
|
||||
# Produces: A.nim.cpp
|
||||
{.localPassc: "-Wall -Werror".} # Passed when compiling A.nim.cpp
|
||||
|
||||
|
||||
PassL pragma
|
||||
------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue