Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutotoolsToolchain] Added [CC|CXX]_FOR_BUILD #3750

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions reference/tools/gnu/autotoolstoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ corresponding build flags like ``-stdlib=libstdc++``, ``-std=gnu14``, architectu
etc. It will also append the folder where the Conan generators are located to the
``PKG_CONFIG_PATH`` environment variable.

Since `Conan 2.4.0 <https://github.com/conan-io/conan/releases/tag/2.4.0>`__,
if it's a cross-building context, ``CC_FOR_BUILD`` and ``CXX_FOR_BUILD`` are also set as environment variables if the
build profile is defining the ``c`` and ``cpp`` values in the conf variable ``tools.build:compiler_executables``.
See more info in the :ref:`conf section<conan_tools_gnu_autotoolstoolchain_conf>`.
czoido marked this conversation as resolved.
Show resolved Hide resolved

This generator will also generate a file called ``conanbuild.conf`` containing two keys:

- **configure_args**: Arguments to call the ``configure`` script.
Expand Down Expand Up @@ -241,12 +246,11 @@ Reference
:members:


.. _conan_tools_gnu_autotoolstoolchain_conf:

conf
^^^^

.. _conan_tools_gnu_autotoolstoolchain_conf:

- ``tools.build:cxxflags`` list of extra C++ flags that will be used by ``CXXFLAGS``.
- ``tools.build:cflags`` list of extra of pure C flags that will be used by ``CFLAGS``.
- ``tools.build:sharedlinkflags`` list of extra linker flags that will be used by ``LDFLAGS``.
Expand All @@ -259,8 +263,9 @@ conf
compiler as key and the compiler executable path as value. Those keys will be mapped as
follows:

* ``c``: will set ``CC`` in *conanautotoolstoolchain.sh|bat* script.
* ``cpp``: will set ``CXX`` in *conanautotoolstoolchain.sh|bat* script.
* ``c``: will set ``CC`` (and ``CC_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
* ``cpp``: will set ``CXX`` (and ``CXX_FOR_BUILD`` if cross-building) in *conanautotoolstoolchain.sh|bat* script.
* ``rc``: will set ``RC`` in *conanautotoolstoolchain.sh|bat* script.
* ``cuda``: will set ``NVCC`` in *conanautotoolstoolchain.sh|bat* script.
* ``fortran``: will set ``FC`` in *conanautotoolstoolchain.sh|bat* script.

Expand Down