Repository: conan-io/conan

Issue:
[question] How to configure XcodeDeps to silence warnings from dependencies?
### What is your question?

We're using Xcode and boost is among our dependencies. However, boost causes a lot of warnings (and with Werror fails to build) and thus we're only able to use boost by specifying the header search paths via `-isystem` which in an xcconfig file needs to be added to `OTHER_CPLUSPLUSFLAGS`.

So I'd like to use the `XcodeDeps` generator, but instead of putting the include paths to `HEADER_SEARCH_PATHS`, I need them to be added to `OTHER_CPLUSPLUSFLAGS` via `-isystem path/to/include`.

How can I achieve that? Is there maybe an option for that or do I need to write my own `XcodeDepsNoWarnings` that does that?
Any suggestion is appreciated.

### Have you read the CONTRIBUTING guide?

- [X] I've read the CONTRIBUTING guide


Discussion:
Hi @wAuner 
Thanks for your question.

Maybe it is not necessary to do it in OTHER_CPLUSPLUSFLAGS, ``SYSTEM_HEADER_SEARCH_PATHS`` seems to exist too.

In this sense, maybe we want to change the default to this one? I think it will be more aligned to what other generators are doing?

Maybe you want to do a quick check, if you know how to run Conan from source, just modify the code in XcodeDeps and try?
Sounds like a good idea, will do. I've already changed the XcodeDeps generator to use `OTHER_CPLUSPLUSFLAGS` for testing. Tomorrow I'll test it with `SYSTEM_HEADER_SEARCH_PATHS` as suggested. 
Sounds like it would be more consistent as you say, according to #8543  the cmake gen also uses this approach (via `-isystem` directly in this case). 
ok using `SYSTEM_HEADER_SEARCH_PATHS` is probably much nicer than doing it via `OTHER_CPLUSPLUSFLAGS` and very easy to implement. I'll open a PR. Thanks for the quick response.

Resolving patch:
diff --git a/conan/tools/apple/xcodedeps.py b/conan/tools/apple/xcodedeps.py
--- a/conan/tools/apple/xcodedeps.py
+++ b/conan/tools/apple/xcodedeps.py
@@ -63,7 +63,7 @@ class XcodeDeps(object):
     _conf_xconfig = textwrap.dedent("""\
         PACKAGE_ROOT_{{pkg_name}}{{condition}} = {{root}}
         // Compiler options for {{pkg_name}}::{{comp_name}}
-        HEADER_SEARCH_PATHS_{{pkg_name}}_{{comp_name}}{{condition}} = {{include_dirs}}
+        SYSTEM_HEADER_SEARCH_PATHS_{{pkg_name}}_{{comp_name}}{{condition}} = {{include_dirs}}
         GCC_PREPROCESSOR_DEFINITIONS_{{pkg_name}}_{{comp_name}}{{condition}} = {{definitions}}
         OTHER_CFLAGS_{{pkg_name}}_{{comp_name}}{{condition}} = {{c_compiler_flags}}
         OTHER_CPLUSPLUSFLAGS_{{pkg_name}}_{{comp_name}}{{condition}} = {{cxx_compiler_flags}}
@@ -82,7 +82,7 @@ class XcodeDeps(object):
         {% endfor %}
         #include "{{dep_xconfig_filename}}"
 
-        HEADER_SEARCH_PATHS = $(inherited) $(HEADER_SEARCH_PATHS_{{pkg_name}}_{{comp_name}})
+        SYSTEM_HEADER_SEARCH_PATHS = $(inherited) $(SYSTEM_HEADER_SEARCH_PATHS_{{pkg_name}}_{{comp_name}})
         GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(GCC_PREPROCESSOR_DEFINITIONS_{{pkg_name}}_{{comp_name}})
         OTHER_CFLAGS = $(inherited) $(OTHER_CFLAGS_{{pkg_name}}_{{comp_name}})
         OTHER_CPLUSPLUSFLAGS = $(inherited) $(OTHER_CPLUSPLUSFLAGS_{{pkg_name}}_{{comp_name}})


Test patch:
diff --git a/conans/test/integration/toolchains/apple/test_xcodedeps.py b/conans/test/integration/toolchains/apple/test_xcodedeps.py
--- a/conans/test/integration/toolchains/apple/test_xcodedeps.py
+++ b/conans/test/integration/toolchains/apple/test_xcodedeps.py
@@ -9,7 +9,7 @@
 from conans.test.utils.tools import TestClient
 
 _expected_dep_xconfig = [
-    "HEADER_SEARCH_PATHS = $(inherited) $(HEADER_SEARCH_PATHS_{name}_{name})",
+    "SYSTEM_HEADER_SEARCH_PATHS = $(inherited) $(SYSTEM_HEADER_SEARCH_PATHS_{name}_{name})",
     "GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(GCC_PREPROCESSOR_DEFINITIONS_{name}_{name})",
     "OTHER_CFLAGS = $(inherited) $(OTHER_CFLAGS_{name}_{name})",
     "OTHER_CPLUSPLUSFLAGS = $(inherited) $(OTHER_CPLUSPLUSFLAGS_{name}_{name})",
@@ -19,7 +19,7 @@
 ]
 
 _expected_conf_xconfig = [
-    "HEADER_SEARCH_PATHS_{name}_{name}[config={configuration}][arch={architecture}][sdk={sdk}{sdk_version}] = ",
+    "SYSTEM_HEADER_SEARCH_PATHS_{name}_{name}[config={configuration}][arch={architecture}][sdk={sdk}{sdk_version}] = ",
     "GCC_PREPROCESSOR_DEFINITIONS_{name}_{name}[config={configuration}][arch={architecture}][sdk={sdk}{sdk_version}] = ",
     "OTHER_CFLAGS_{name}_{name}[config={configuration}][arch={architecture}][sdk={sdk}{sdk_version}] = ",
     "OTHER_CPLUSPLUSFLAGS_{name}_{name}[config={configuration}][arch={architecture}][sdk={sdk}{sdk_version}] = ",