From 25ad10e501ba11a017a63404756a1e796427b118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20V=C3=A4in=C3=B6l=C3=A4?= Date: Sun, 13 Sep 2020 07:52:56 +0300 Subject: [PATCH] Add VS include directories to projects as well - "Go To Document" action previously only worked on c/cpp files which had the include directories set but it was not possible to move from header to another header. --- mesonbuild/backend/vs2010backend.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 4fc3d5c01..4e95c80b9 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -996,6 +996,9 @@ class Vs2010Backend(backends.Backend): # De-dup if inc_dir not in file_inc_dirs[l]: file_inc_dirs[l].append(inc_dir) + # Add include dirs to target as well so that "Go to Document" works in headers + if inc_dir not in target_inc_dirs: + target_inc_dirs.append(inc_dir) # Split compile args needed to find external dependencies # Link args are added while generating the link command @@ -1025,8 +1028,6 @@ class Vs2010Backend(backends.Backend): if len(target_args) > 0: target_args.append('%(AdditionalOptions)') ET.SubElement(clconf, "AdditionalOptions").text = ' '.join(target_args) - - target_inc_dirs.append('%(AdditionalIncludeDirectories)') ET.SubElement(clconf, 'AdditionalIncludeDirectories').text = ';'.join(target_inc_dirs) target_defines.append('%(PreprocessorDefinitions)') ET.SubElement(clconf, 'PreprocessorDefinitions').text = ';'.join(target_defines)