%namespace file="packages.include" import="gen_package_props,gen_package_targets,gen_package_ensure"/>\
<%def name="to_windows_path(path)">${path.replace('/','\\')}%def>\
<%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}%def>\
<%def name="item_definition_group(project, target, debug, dll, _64bit)">\
NotUsing
Level3
${'Disabled' if debug else 'MaxSpeed'}
WIN32;${'_DEBUG' if debug else 'NDEBUG'};_LIB;%(PreprocessorDefinitions)
% if not debug:
true
true
% endif
true
${'MultiThreadedDebug' if debug else 'MultiThreaded'}
${'false' if target.boringssl else 'true'}
None
## Silence D9007 warning. See #4508
false
${get_subsystem(project.is_library)}
true
false
% if not debug:
true
true
% endif
%def>\
<%def name="gen_project(name, collection)">\
<%
target = None
for p in vsprojects:
if p.name == name:
project = p
for t in collection:
if t.name == name:
target = t
props = project.vs_props
packages = project.vs_packages
configuration_type = project.vs_config_type
project_guid = project.vs_project_guid
if target.build == 'test' and target.language == 'c++':
props.extend(['cpptest'])
if configuration_type == 'Application':
if target.build == 'protoc':
props.extend(['protoc', 'protobuf'])
else:
if target.language == 'c++':
props.extend(['protobuf'])
props.extend(['winsock', 'zlib'])
packages.extend(['grpc.dependencies.zlib'])
if target.get('secure', 'check'):
props.extend(['openssl'])
packages.extend(['grpc.dependencies.openssl'])
else:
props.extend(['winsock'])
props.extend(['global'])
props = sorted(list(set(props)))
packages = sorted(list(set(packages)))
dll = project.get('dll', False)
repo_root = '$(SolutionDir)\..'
%>\
${gen_package_props(packages, repo_root)}\
% if dll and dll != 'only':
Debug-DLL
Win32
Debug-DLL
x64
Release-DLL
Win32
Release-DLL
x64
% endif
Debug
Win32
Debug
x64
Release
Win32
Release
x64
${project_guid if project_guid else project.vs_project_guid}
## Silence MSB8029 warning. See #4506
true
## Use different location for intermediate directory to make path shorter than 260 characters.
$(SolutionDir)IntDir\$(MSBuildProjectName)\
v100
v110
v120
v140
${configuration_type}
true
Unicode
${configuration_type}
false
true
Unicode
% if dll and dll != 'only':
${configuration_type}
true
Unicode
${configuration_type}
false
true
Unicode
% endif
% for prop in props:
% endfor
% for config in ['Debug', 'Release']:# + (['Debug-DLL', 'Release-DLL'] if dll and dll != 'only' else []):
${name}
% for package in vspackages:
% if packages == 'all' or package.name in packages:
% if package.get('linkage', None) is not None:
${package.linkage}
% endif
${config}
% endif
% endfor
% endfor
% if dll and dll != 'only':
${item_definition_group(project, target, True, True, False)}
${item_definition_group(project, target, True, True, True)}
${item_definition_group(project, target, False, True, False)}
${item_definition_group(project, target, False, True, True)}
% endif
${item_definition_group(project, target, True, False, False)}
${item_definition_group(project, target, True, False, True)}
${item_definition_group(project, target, False, False, False)}
${item_definition_group(project, target, False, False, True)}
% if project.get('public_headers',[]):
% for public_header in project.public_headers:
% endfor
% endif
% if project.get('headers',[]):
% for header in project.headers:
% endfor
% endif
% if project.get('src',[]):
% for src_name in project.src:
% if src_name.endswith(".proto"):
<% src_name_parts = src_name.split(".") %>\
% else:
% endif
% endfor
% elif configuration_type != 'StaticLibrary':
% endif
% if project.get('deps',[]):
% for dep in project.deps:
${vsproject_dict[dep].vs_project_guid}
% endfor
% endif
%if packages:
%endif
${gen_package_targets(packages, repo_root)}\
${gen_package_ensure(packages, repo_root)}\
%def>\