diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-27 09:29:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-10-27 08:33:26 +0200 |
commit | 9be47276cdd6a59647f6aa42d2cd35f05c51a16b (patch) | |
tree | 98cf9ed4d5b179d7d53452f896bd41451ad196fb /bin | |
parent | eb9525a6aedb05dbb98c7d37abf05abcbfea4e48 (diff) |
VisualStudioIntegrationGenerator: honor defines' values
Before this, -D_WIN32_WINNT=0x0601 used to land to VS project simply
as _WIN32_WINNT (without value).
Change-Id: I68ebdc24c3181c5d9e046280756e4cefee3de46c
Reviewed-on: https://gerrit.libreoffice.org/43928
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gbuild-to-ide | 13 | ||||
-rwxr-xr-x | bin/gbuild-to-ideNS | 13 |
2 files changed, 24 insertions, 2 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index d50801c3e6ca..4f6a94058fab 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -925,6 +925,17 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): f.write('\tEndGlobalSection\n') f.write('EndGlobal\n') + @staticmethod + def defs_list(defs): + defines_list = [] + # List defines + for key, value in defs.items(): + define = key + if value is not None: + define += '=' + value + defines_list.append(define) + return defines_list + def write_project(self, project_path, target): # See info at http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx folder = os.path.dirname(project_path) @@ -993,7 +1004,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % ns) nmake_output_node.text = os.path.join('../..', 'program', 'soffice.exe') nmake_defs_node = ET.SubElement(conf_node, '{%s}NMakePreprocessorDefinitions' % ns) - nmake_defs_node.text = ';'.join(list(target['DEFS']) + ['$(NMakePreprocessorDefinitions)']) + nmake_defs_node.text = ';'.join(self.defs_list(target['DEFS']) + ['$(NMakePreprocessorDefinitions)']) include_path_node = ET.SubElement(conf_node, '{%s}IncludePath' % ns) includes = [os.path.join('../..', elem) if elem[1] != ':' else elem for elem in target['include']] include_path_node.text = ';'.join(includes + ['$(IncludePath)']) diff --git a/bin/gbuild-to-ideNS b/bin/gbuild-to-ideNS index 5fca58cf227d..abf7c7c572bb 100755 --- a/bin/gbuild-to-ideNS +++ b/bin/gbuild-to-ideNS @@ -831,6 +831,17 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): f.write('EndGlobal\n') print('') + @staticmethod + def defs_list(defs): + defines_list = [] + # List defines + for key, value in defs.items(): + define = key + if value is not None: + define += '=' + value + defines_list.append(define) + return defines_list + def write_project(self, project_path, target): # See info at http://blogs.msdn.com/b/visualstudio/archive/2010/05/14/a-guide-to-vcxproj-and-props-file-structure.aspx folder = os.path.dirname(project_path) @@ -899,7 +910,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): nmake_output_node = ET.SubElement(conf_node, '{%s}NMakeOutput' % ns) nmake_output_node.text = os.path.join(self.gbuildparser.instdir, 'program', 'soffice.exe') nmake_defs_node = ET.SubElement(conf_node, '{%s}NMakePreprocessorDefinitions' % ns) - nmake_defs_node.text = ';'.join(list(target.defs) + ['$(NMakePreprocessorDefinitions)']) + 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)']) |