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: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
eaf3c9e5d1
commit
f7ec0b0ac4
@ -1031,6 +1031,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
||||
if not os.path.exists(folder):
|
||||
os.makedirs(folder)
|
||||
project_guid = str(uuid.uuid4()).upper()
|
||||
cxxflags = ' '.join(target.cxxflags)
|
||||
ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
|
||||
ET.register_namespace('', ns)
|
||||
proj_node = ET.Element('{%s}Project' % ns, DefaultTargets='Build', ToolsVersion='4.0')
|
||||
@ -1100,6 +1101,8 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
||||
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 = 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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user