Toolchain: Update documentation for initial compiler flags

This commit is contained in:
Fred Baksik
2020-07-15 15:03:46 -04:00
parent deec2f587c
commit db486da265
10 changed files with 91 additions and 1 deletions

View File

@@ -14,3 +14,11 @@ in the cache as
:variable:`CMAKE_ASM<DIALECT>_COMPILER <CMAKE_<LANG>_COMPILER>`. For subsequent
configuration runs, the environment variable will be ignored in favor of
:variable:`CMAKE_ASM<DIALECT>_COMPILER <CMAKE_<LANG>_COMPILER>`.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export ASM="custom-compiler --arg1 --arg2"

View File

@@ -11,3 +11,11 @@ value for ``CC`` is stored in the cache as
:variable:`CMAKE_C_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration run
(including the first), the environment variable will be ignored if the
:variable:`CMAKE_C_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export CC="custom-compiler --arg1 --arg2"

View File

@@ -5,7 +5,7 @@ CSFLAGS
.. include:: ENV_VAR.txt
Preferred executable for compiling ``CSharp`` language files. Will only be
Default compilation flags to be used when compiling ``CSharp`` files. Will only be
used by CMake on the first configuration to determine ``CSharp`` default
compilation flags, after which the value for ``CSFLAGS`` is stored in the cache
as :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration

View File

@@ -11,3 +11,11 @@ value for ``CUDA`` is stored in the cache as
:variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration
run (including the first), the environment variable will be ignored if the
:variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export CUDACXX="custom-compiler --arg1 --arg2"

View File

@@ -11,3 +11,11 @@ value for ``CXX`` is stored in the cache as
:variable:`CMAKE_CXX_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration
run (including the first), the environment variable will be ignored if the
:variable:`CMAKE_CXX_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export CXX="custom-compiler --arg1 --arg2"

View File

@@ -12,3 +12,11 @@ which the value for ``Fortran`` is stored in the cache as
configuration run (including the first), the environment variable will be
ignored if the :variable:`CMAKE_Fortran_COMPILER <CMAKE_<LANG>_COMPILER>`
variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export FC="custom-compiler --arg1 --arg2"

View File

@@ -11,3 +11,11 @@ value for ``RC`` is stored in the cache as
:variable:`CMAKE_RC_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration run
(including the first), the environment variable will be ignored if the
:variable:`CMAKE_RC_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export RC="custom-compiler --arg1 --arg2"

View File

@@ -11,3 +11,11 @@ value for ``SWIFTC`` is stored in the cache as
:variable:`CMAKE_Swift_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration run
(including the first), the environment variable will be ignored if the
:variable:`CMAKE_Swift_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
.. note::
Options that are required to make the compiler work correctly can be included;
they can not be changed.
.. code-block:: console
$ export SWIFTC="custom-compiler --arg1 --arg2"

View File

@@ -0,0 +1,9 @@
compiler_flags
-----------------
* The :variable:`CMAKE_<LANG>_COMPILER` variable may now be used to
store "mandatory" compiler flags like the :envvar:`CC` and other environment variables.
* The :variable:`CMAKE_<LANG>_FLAGS_INIT` variable will now be considered during
the compiler indentification check if other sources like :variable:`CMAKE_<LANG>_FLAGS`
or :envvar:`CFLAGS` are not set.

View File

@@ -5,3 +5,28 @@ The full path to the compiler for ``LANG``.
This is the command that will be used as the ``<LANG>`` compiler. Once
set, you can not change this variable.
Usage
^^^^^
This variable can be set by the user during the first time a build tree is configured.
If a non-full path value is supplied then CMake will resolve the full path of
the compiler.
The variable could be set in a user supplied toolchain file or via `-D` on the command line.
.. note::
Options that are required to make the compiler work correctly can be included
as items in a list; they can not be changed.
.. code-block:: cmake
#set within user supplied toolchain file
set(CMAKE_C_COMPILER /full/path/to/qcc --arg1 --arg2)
or
.. code-block:: console
$ cmake ... -DCMAKE_C_COMPILER='qcc;--arg1;--arg2'