bin/gbuild-to-ide |   33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

New commits:
commit ee058521541da49e6d1d8a0e84cc42e9e801b518
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Nov 1 11:58:08 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Nov 1 11:48:04 2023 +0100

    VS IDE integration: Use LocalDebuggerCommand for startup executable
    
    Before that, NMakeOutput was abused for that. Now it will point to
    the correct link target.
    
    Change-Id: I9c3fd57948cc24a99f54a1c23ca5e0351d25a0dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158748
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index fb1b84bcc52e..928cde4ae9fc 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,9 +26,9 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-        (self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs) = (
-            name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs)
+    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+        (self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs, self.link_target) = (
+            name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs, link_target)
 
     def short_name(self):
         return self.name
@@ -43,8 +43,8 @@ class GbuildLinkTarget:
 
 
 class GbuildLib(GbuildLinkTarget):
-    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
     def short_name(self):
         """Return the short name of target based on the Library_* makefile 
name"""
@@ -57,8 +57,8 @@ class GbuildLib(GbuildLinkTarget):
         return self.name
 
 class GbuildTest(GbuildLinkTarget):
-    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
     def short_name(self):
         """Return the short name of target based n the CppunitTest_* makefile 
names"""
@@ -68,8 +68,8 @@ class GbuildTest(GbuildLinkTarget):
         return 'CppunitTest_%s' % self.name
 
 class GbuildExe(GbuildLinkTarget):
-    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs):
-        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs)
+    def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
+        GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
 
     def short_name(self):
         """Return the short name of target based on the Executable_* makefile 
name"""
@@ -148,7 +148,8 @@ class GbuildParser:
             GbuildParser.__split_objs(json['COBJECTS']),
             GbuildParser.__split_objs(json['OBJCXXOBJECTS']),
             GbuildParser.__split_flags(json['CFLAGS'], json['CFLAGSAPPEND']),
-            json['LINKED_LIBS'].strip().split(' '))
+            json['LINKED_LIBS'].strip().split(' '),
+            json['LINKTARGET'].strip())
 
     @staticmethod
     def __test_from_json(json):
@@ -172,7 +173,8 @@ class GbuildParser:
             GbuildParser.__split_objs(json['COBJECTS']),
             GbuildParser.__split_objs(json['OBJCXXOBJECTS']),
             GbuildParser.__split_flags(json['CFLAGS'], json['CFLAGSAPPEND']),
-            json['LINKED_LIBS'].strip().split(' '))
+            json['LINKED_LIBS'].strip().split(' '),
+            json['LINKTARGET'].strip())
 
     @staticmethod
     def __exe_from_json(json):
@@ -188,7 +190,8 @@ class GbuildParser:
             GbuildParser.__split_objs(json['COBJECTS']),
             GbuildParser.__split_objs(json['OBJCXXOBJECTS']),
             GbuildParser.__split_flags(json['CFLAGS'], json['CFLAGSAPPEND']),
-            json['LINKED_LIBS'].strip().split(' '))
+            json['LINKED_LIBS'].strip().split(' '),
+            json['LINKTARGET'].strip())
 
     def parse(self):
         for jsonfilename in os.listdir(os.path.join(self.workdir, 
'GbuildToJson', 'Library')):
@@ -1145,9 +1148,13 @@ class 
VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
             nmake_rebuild_node = ET.SubElement(conf_node, 
'{%s}NMakeReBuildCommandLine' % ns)
             nmake_rebuild_node.text = cfg_targets['rebuild'] % nmake_params
             nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % 
ns)
-            nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 
'program', 'soffice.bin')
+            nmake_output_node.text = os.path.join(self.gbuildparser.workdir, 
'LinkTarget', target.link_target)
             nmake_defs_node = ET.SubElement(conf_node, 
'{%s}NMakePreprocessorDefinitions' % ns)
             nmake_defs_node.text = ';'.join(self.defs_list(target.defs) + 
['$(NMakePreprocessorDefinitions)'])
+            nmake_debug_command_node = ET.SubElement(conf_node, 
'{%s}LocalDebuggerCommand' % ns)
+            nmake_debug_command_node.text = 
os.path.join(self.gbuildparser.instdir, 'program', 'soffice.bin')
+            nmake_debug_flavor_node = ET.SubElement(conf_node, 
'{%s}DebuggerFlavor' % ns)
+            nmake_debug_flavor_node.text = 'WindowsLocalDebugger'
             include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % 
ns)
             include_path_node.text = include_path_node_text
             additional_options_node = ET.SubElement(conf_node, 
'{%s}AdditionalOptions' % ns)

Reply via email to