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

Docs for xcodetoolchain global flags #2471

Merged
merged 5 commits into from Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion reference/conanfile/tools/apple.rst
Expand Up @@ -192,7 +192,8 @@ Will create these files:
├── conan_config.xcconfig
├── conantoolchain_release_x86_64.xcconfig
├── conantoolchain_debug_x86_64.xcconfig
└── conantoolchain.xcconfig
├── conantoolchain.xcconfig
└── conan_global_flags.xcconfig

Those files are:

Expand All @@ -204,6 +205,9 @@ Those files are:
conditional logic depending on the build configuration, architecture and sdk set.
- *conantoolchain.xcconfig*: aggregates all the *conantoolchain_<config>_<arch>.xcconfig*
files for the different installed configurations.
- *conan_global_flags.xcconfig*: this file will only be generated in case of any
configuration variables related to compiler or linker flags are set. Check :ref:`the
configuration section<xcodetoolchain_conf>` below for more details.


Every invocation to ``conan install`` with different configuration will create a new
Expand All @@ -224,6 +228,22 @@ The XcodeToolchain files can declare the following Xcode build settings based on
One of the advantages of using toolchains is that they can help to achieve the exact same build
with local development flows, than when the package is created in the cache.

.. _xcodetoolchain_conf:

conf
++++

This toolchain is also affected by these :ref:`[conf]<global_conf>` variables:

- ``tools.build:cxxflags`` list of C++ flags.
- ``tools.build:cflags`` list of pure C flags.
- ``tools.build:sharedlinkflags`` list of flags that will be used by the linker when creating a shared library.
- ``tools.build:exelinkflags`` list of flags that will be used by the linker when creating an executable.
- ``tools.build:defines`` list of preprocessor definitions.

If you set any of these variables, the toolchain will use them to generate the
``conan_global_flags.xcconfig`` file that will be included from the ``conan_config.xcconfig``
file.

XcodeBuild
----------
Expand Down