[Libreoffice-commits] core.git: bin/gbuild-to-ide
Mike Kaganski
mike.kaganski at collabora.com
Wed May 2 14:32:23 UTC 2018
bin/gbuild-to-ide | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
New commits:
commit ea1f50894ac3e681213b874af08217ae25d0433a
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Wed May 2 13:29:21 2018 +0100
VS IDE integration: use full Windows include paths in VS projects
It turns out that VS IDE's "Peek definition" (and other functions that
navigate to sources) fail if the short ("DOS") path to the file is given
in project's includes: see issue at
https://developercommunity.visualstudio.com/content/problem/139659/vc-peek-definition-fails-to-navigate-to-windows-ki.html
This patch converts the include paths to full Windows paths, to avoid the
problem. Also, since IDE starts working correctly with this change, this
patch removes inclusion of "inherited" paths "$(IncludePath)", which are
the paths added by Visual Studio itself. Since we do specify all include
paths explicitly, that is not required, and avoids confusion.
Change-Id: Ide2d948f8c7b050b02f550342144fede4fcafb82
Reviewed-on: https://gerrit.libreoffice.org/53731
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 8507de280d83..90a732d7c614 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -19,6 +19,8 @@ import json
import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
import traceback
+import subprocess
+from sys import platform
class GbuildLinkTarget:
@@ -828,6 +830,13 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
print('')
@staticmethod
+ def to_long_names(shortnames):
+ if platform == "cygwin":
+ return (subprocess.check_output(["cygpath", "-wal"] + shortnames).decode("utf-8", "strict").rstrip()).split("\n")
+ else:
+ return shortnames
+
+ @staticmethod
def defs_list(defs):
defines_list = []
# List defines
@@ -888,6 +897,10 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
Label='LocalAppDataPlatform')
ET.SubElement(proj_node, '{%s}PropertyGroup' % ns, Label='UserMacros')
+ # VS IDE (at least "Peek definition") is allergic to paths like "C:/PROGRA~2/WI3CF2~1/10/Include/10.0.14393.0/um"; see
+ # https://developercommunity.visualstudio.com/content/problem/139659/vc-peek-definition-fails-to-navigate-to-windows-ki.html
+ # We need to convert to long paths here. Do this once, since it's time-consuming operation.
+ include_path_node_text = ';'.join(self.to_long_names(target.include))
for cfg_name, cfg_targets in self.configurations.items():
conf_node = ET.SubElement(proj_node, '{%s}PropertyGroup' % ns,
Condition="'$(Configuration)|$(Platform)'=='%s|%s'" % (cfg_name, platform))
@@ -908,7 +921,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
nmake_defs_node = ET.SubElement(conf_node, '{%s}NMakePreprocessorDefinitions' % ns)
nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + ['$(NMakePreprocessorDefinitions)'])
include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % ns)
- include_path_node.text = ';'.join(target.include + ['$(IncludePath)'])
+ include_path_node.text = include_path_node_text
ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
More information about the Libreoffice-commits
mailing list