Skip to content

Commit

Permalink
Added extra conf flags descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
franramirez688 committed Mar 31, 2022
1 parent ea7efb7 commit 0bb2c53
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
17 changes: 17 additions & 0 deletions reference/conanfile/tools/cmake/cmaketoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,23 @@ For single-configuration build systems:
$ cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
$ cmake --build . # or just "make"
conf
+++++

``CMakeToolchain`` is affected by these :ref:`[conf]<global_conf>` variables:

- ``tools.cmake.cmaketoolchain:toolchain_file`` user toolchain file to replace the ``conan_toolchain.cmake`` one.
- ``tools.cmake.cmaketoolchain:user_toolchain`` list of user toolchains to be included from the ``conan_toolchain.cmake`` file.
- ``tools.android:ndk_path`` value for ``CMAKE_ANDROID_NDK``.
- ``tools.cmake.cmaketoolchain:system_name`` value for ``CMAKE_SYSTEM_NAME``.
- ``tools.cmake.cmaketoolchain:system_version`` value for ``CMAKE_SYSTEM_VERSION``.
- ``tools.cmake.cmaketoolchain:system_processor`` value for ``CMAKE_SYSTEM_PROCESSOR``.
- ``tools.build:cxxflags`` list of extra C++ flags that will be used by ``CONAN_CXX_FLAGS`` (appended to ``CMAKE_CXX_FLAGS_INIT``).
- ``tools.build:cflags`` list of extra of pure C flags that will be used by ``CONAN_C_FLAGS`` (appended to ``CMAKE_C_FLAGS_INIT``).
- ``tools.build:sharedlinkflags`` list of extra linker flags that will be used by ``CONAN_SHARED_LINKER_FLAGS`` (appended to ``CMAKE_SHARED_LINKER_FLAGS_INIT``).
- ``tools.build:exelinkflags`` list of extra linker flags that will be used by by ``CONAN_EXE_LINKER_FLAGS`` (appended to ``CMAKE_EXE_LINKER_FLAGS_INIT``).
- ``tools.build:defines`` list of preprocessor definitions that will be used by ``add_definitions()``.


Extending and customizing CMakeToolchain
++++++++++++++++++++++++++++++++++++++++
Expand Down
11 changes: 11 additions & 0 deletions reference/conanfile/tools/gnu/autotoolstoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ values:
It is **not valid** to change the self.cpp_info at the ``package_info()`` method.


conf
+++++

``AutotoolsToolchain`` is affected by these :ref:`[conf]<global_conf>` variables:

- ``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``.
- ``tools.build:exelinkflags`` list of extra linker flags that will be used by by ``LDFLAGS``.
- ``tools.build:defines`` list of preprocessor definitions that will be used by ``CPPFLAGS``.


Customizing the environment
+++++++++++++++++++++++++++
Expand Down
15 changes: 11 additions & 4 deletions reference/conanfile/tools/meson/mesontoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ With the ``MesonToolchain`` it is possible to do:
conf
++++

``MesonToolchain`` is affected by these configuration variables:
``MesonToolchain`` is affected by these :ref:`[conf]<global_conf>` variables:

- ``tools.meson.mesontoolchain:backend``. the meson `backend
<https://mesonbuild.com/Configuring-a-build-directory.html>`_ to use. Possible values:
Expand All @@ -149,6 +149,13 @@ conf
- ``tools.android:ndk_path`` argument for NDK path in case of Android cross-compilation. It will be used to get
some binaries like ``c``, ``cpp`` and ``ar`` used in ``[binaries]`` section from *conan_meson_cross.ini*.

Apart from that, since Conan 1.47, you can inject extra flags thanks to these ones:

- ``tools.build:cxxflags`` list of extra C++ flags that will be used by ``cpp_args``.
- ``tools.build:cflags`` list of extra of pure C flags that will be used by ``c_args``.
- ``tools.build:sharedlinkflags`` list of extra linker flags that will be used by ``c_link_args`` and ``cpp_link_args``.
- ``tools.build:exelinkflags`` list of extra linker flags that will be used by by ``c_link_args`` and ``cpp_link_args``.


Cross-building for Apple and Android
+++++++++++++++++++++++++++++++++++++
Expand All @@ -165,9 +172,9 @@ into Meson ``c_args``, ``c_link_args``, ``cpp_args`` and ``cpp_link_args`` built

It'll initialize the ``c``, ``cpp`` and ``ar`` variables which are needed to cross-compile for Android. For instance:

* c=$TOOLCHAIN/bin/llvm-ar
* cpp=$TOOLCHAIN/bin/$TARGET$API-clang
* ar=$TOOLCHAIN/bin/$TARGET$API-clang++
* ``c == $TOOLCHAIN/bin/llvm-ar``
* ``cpp == $TOOLCHAIN/bin/$TARGET$API-clang``
* ``ar == $TOOLCHAIN/bin/$TARGET$API-clang++``

Where:

Expand Down

0 comments on commit 0bb2c53

Please sign in to comment.