Kaydet (Commit) f7ec0b0a authored tarafından Mike Kaganski's avatar Mike Kaganski

VisualStudioIntegrationGenerator: put CXXFLAGS to AdditionalOptions

Adding AdditionalOptions to nmake project settings allows IntelliSense
to know about used compiler switches; specifically, passing std switch
(currently -std:c++17) defines _MSVC_LANG macro [1] to proper value to
avoid false IntelliSense errors (e.g., for string_view).

[1] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

Change-Id: I90309e6bf2a87257a0c81b1406e678af962eb587
Reviewed-on: https://gerrit.libreoffice.org/67805
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst eaf3c9e5
...@@ -1031,6 +1031,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1031,6 +1031,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
if not os.path.exists(folder): if not os.path.exists(folder):
os.makedirs(folder) os.makedirs(folder)
project_guid = str(uuid.uuid4()).upper() project_guid = str(uuid.uuid4()).upper()
cxxflags = ' '.join(target.cxxflags)
ns = 'http://schemas.microsoft.com/developer/msbuild/2003' ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
ET.register_namespace('', ns) ET.register_namespace('', ns)
proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', ToolsVersion='4.0') proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', ToolsVersion='4.0')
...@@ -1100,6 +1101,8 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): ...@@ -1100,6 +1101,8 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
nmake_defs_node.text = ';'.join(self.defs_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 = ET.SubElement(conf_node, '{%s}IncludePath' % ns)
include_path_node.text = include_path_node_text include_path_node.text = include_path_node_text
additional_options_node = ET.SubElement(conf_node, '{%s}AdditionalOptions' % ns)
additional_options_node.text = cxxflags
ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns) ET.SubElement(proj_node, '{%s}ItemDefinitionGroup' % ns)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment