aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nnoble@google.com>2015-07-30 15:39:43 -0700
committerGravatar Nicolas Noble <nnoble@google.com>2015-07-30 19:17:03 -0700
commit563b8a2779d2887e5030672cdeb3122aaca8b376 (patch)
tree5ec4a5efae4e5c18ff7e2ad670f9b4a570122e65 /templates
parent772fb1e9772373f6fa8b815860da222b3e9c8b42 (diff)
Regenerating project files and massaging VS project files.
Diffstat (limited to 'templates')
-rw-r--r--templates/vsprojects/grpc.sln.template4
-rw-r--r--templates/vsprojects/grpc_csharp_ext.sln.template5
-rw-r--r--templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template2
-rw-r--r--templates/vsprojects/sln_defs.include56
-rw-r--r--templates/vsprojects/vcxproj_defs.include145
5 files changed, 173 insertions, 39 deletions
diff --git a/templates/vsprojects/grpc.sln.template b/templates/vsprojects/grpc.sln.template
index 70be6b4f7a..5c5e28c885 100644
--- a/templates/vsprojects/grpc.sln.template
+++ b/templates/vsprojects/grpc.sln.template
@@ -1,5 +1,5 @@
<%namespace file="sln_defs.include" import="gen_solution"/>\
<%
-solution_projects = [p for p in vsprojects if p.build != 'protoc']
+solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language in ['c', 'c++']]
%>\
-${gen_solution(solution_projects)} \ No newline at end of file
+${gen_solution(solution_projects, use_dlls='yes')} \ No newline at end of file
diff --git a/templates/vsprojects/grpc_csharp_ext.sln.template b/templates/vsprojects/grpc_csharp_ext.sln.template
new file mode 100644
index 0000000000..eb33ce2eb6
--- /dev/null
+++ b/templates/vsprojects/grpc_csharp_ext.sln.template
@@ -0,0 +1,5 @@
+<%namespace file="sln_defs.include" import="gen_solution"/>\
+<%
+solution_projects = [p for p in vsprojects if p.build == 'all' and p.language in ['c', 'csharp']]
+%>\
+${gen_solution(solution_projects, use_dlls='only')} \ No newline at end of file
diff --git a/templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template b/templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template
index 8a5f1ca5b7..25b02b8c82 100644
--- a/templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template
+++ b/templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template
@@ -1,2 +1,2 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
-${gen_project('grpc_csharp_ext', libs, configuration_type = 'DynamicLibrary', props = ['winsock'], packages=['openssl','zlib'])}
+${gen_project('grpc_csharp_ext', libs, configuration_type = 'DynamicLibrary', props=['zlib-dll'], packages=['openssl','zlib'])}
diff --git a/templates/vsprojects/sln_defs.include b/templates/vsprojects/sln_defs.include
index 4ba0fbff07..224f2cd1d5 100644
--- a/templates/vsprojects/sln_defs.include
+++ b/templates/vsprojects/sln_defs.include
@@ -1,4 +1,4 @@
-<%def name="gen_solution(solution_projects)">\
+<%def name="gen_solution(solution_projects, use_dlls = 'no')">\
## Template for Visual Studio solution
## based on http://msdn.microsoft.com/en-us/library/bb165951(v=vs.90).aspx
## NOTE: tabs in this file are needed by Visual Studio to correctly interpret
@@ -35,11 +35,63 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
+% if use_dlls == 'yes':
+ Debug-DLL|Win32 = Debug-DLL|Win32
+ Debug-DLL|x64 = Debug-DLL|x64
+% endif
Release|Win32 = Release|Win32
Release|x64 = Release|x64
+% if use_dlls == 'yes':
+ Release-DLL|Win32 = Release-DLL|Win32
+ Release-DLL|x64 = Release-DLL|x64
+% endif
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
% for project in solution_projects:
+ % if use_dlls != 'only':
+ ${project.vs_project_guid}.Debug|Win32.ActiveCfg = Debug|Win32
+ ${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug|x64
+ ${project.vs_project_guid}.Release|Win32.ActiveCfg = Release|Win32
+ ${project.vs_project_guid}.Release|x64.ActiveCfg = Release|x64
+ % if project.get('dll', 'no') != 'only':
+ ${project.vs_project_guid}.Debug|Win32.Build.0 = Debug|Win32
+ ${project.vs_project_guid}.Debug|x64.Build.0 = Debug|x64
+ ${project.vs_project_guid}.Release|Win32.Build.0 = Release|Win32
+ ${project.vs_project_guid}.Release|x64.Build.0 = Release|x64
+ % endif
+ % endif
+ % if use_dlls == 'yes':
+ % if project.get('dll', 'no') == 'no':
+ ${project.vs_project_guid}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
+ ${project.vs_project_guid}.Debug-DLL|Win32.Build.0 = Debug|Win32
+ ${project.vs_project_guid}.Debug-DLL|x64.ActiveCfg = Debug|x64
+ ${project.vs_project_guid}.Debug-DLL|x64.Build.0 = Debug|x64
+ ${project.vs_project_guid}.Release-DLL|Win32.ActiveCfg = Release|Win32
+ ${project.vs_project_guid}.Release-DLL|Win32.Build.0 = Release|Win32
+ ${project.vs_project_guid}.Release-DLL|x64.ActiveCfg = Release|x64
+ ${project.vs_project_guid}.Release-DLL|x64.Build.0 = Release|x64
+ % else:
+ ${project.vs_project_guid}.Debug-DLL|Win32.ActiveCfg = Debug-DLL|Win32
+ ${project.vs_project_guid}.Debug-DLL|Win32.Build.0 = Debug-DLL|Win32
+ ${project.vs_project_guid}.Debug-DLL|x64.ActiveCfg = Debug-DLL|x64
+ ${project.vs_project_guid}.Debug-DLL|x64.Build.0 = Debug-DLL|x64
+ ${project.vs_project_guid}.Release-DLL|Win32.ActiveCfg = Release-DLL|Win32
+ ${project.vs_project_guid}.Release-DLL|Win32.Build.0 = Release-DLL|Win32
+ ${project.vs_project_guid}.Release-DLL|x64.ActiveCfg = Release-DLL|x64
+ ${project.vs_project_guid}.Release-DLL|x64.Build.0 = Release-DLL|x64
+ % endif
+ % endif
+ % if use_dlls == 'only':
+ % if project.get('dll', 'no') == 'yes':
+ ${project.vs_project_guid}.Debug|Win32.ActiveCfg = Debug-DLL|Win32
+ ${project.vs_project_guid}.Debug|Win32.Build.0 = Debug-DLL|Win32
+ ${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug-DLL|x64
+ ${project.vs_project_guid}.Debug|x64.Build.0 = Debug-DLL|x64
+ ${project.vs_project_guid}.Release|Win32.ActiveCfg = Release-DLL|Win32
+ ${project.vs_project_guid}.Release|Win32.Build.0 = Release-DLL|Win32
+ ${project.vs_project_guid}.Release|x64.ActiveCfg = Release-DLL|x64
+ ${project.vs_project_guid}.Release|x64.Build.0 = Release-DLL|x64
+ % else:
${project.vs_project_guid}.Debug|Win32.ActiveCfg = Debug|Win32
${project.vs_project_guid}.Debug|Win32.Build.0 = Debug|Win32
${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug|x64
@@ -48,6 +100,8 @@ Global
${project.vs_project_guid}.Release|Win32.Build.0 = Release|Win32
${project.vs_project_guid}.Release|x64.ActiveCfg = Release|x64
${project.vs_project_guid}.Release|x64.Build.0 = Release|x64
+ % endif
+ % endif
% endfor
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
diff --git a/templates/vsprojects/vcxproj_defs.include b/templates/vsprojects/vcxproj_defs.include
index 39c7386062..507c9a5204 100644
--- a/templates/vsprojects/vcxproj_defs.include
+++ b/templates/vsprojects/vcxproj_defs.include
@@ -22,17 +22,37 @@
if target.build == 'test' and target.language == 'c++':
props.extend(['cpptest'])
if configuration_type == 'Application':
- print target.build
if target.build == 'protoc':
props.extend(['protoc'])
else:
props.extend(['winsock', 'protobuf', 'zlib', 'openssl'])
+ else:
+ props.extend(['winsock'])
props.extend(['global'])
+ dll = project.get('dll', 'no')
%>\
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
${gen_package_props(packages)}\
<ItemGroup Label="ProjectConfigurations">
+% if dll == 'yes':
+ <ProjectConfiguration Include="Debug-DLL|Win32">
+ <Configuration>Debug-DLL</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug-DLL|x64">
+ <Configuration>Debug-DLL</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release-DLL|Win32">
+ <Configuration>Release-DLL</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release-DLL|x64">
+ <Configuration>Release-DLL</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+% endif
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@@ -63,57 +83,41 @@ ${gen_package_props(packages)}\
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>${configuration_type}</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>${configuration_type}</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+% if dll == 'yes':
+ <PropertyGroup Condition="'$(Configuration)'=='Debug-DLL'" Label="Configuration">
<ConfigurationType>${configuration_type}</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
+ <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <PropertyGroup Condition="'$(Configuration)'=='Release-DLL'" Label="Configuration">
<ConfigurationType>${configuration_type}</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
+% endif
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- % for prop in props:
- <Import Project="..\${prop}.props" />
- % endfor
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- % for prop in props:
- <Import Project="..\${prop}.props" />
- % endfor
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- % for prop in props:
- <Import Project="..\${prop}.props" />
- % endfor
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
% for prop in props:
<Import Project="..\${prop}.props" />
% endfor
</ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>${name}</TargetName>
% if "zlib" in packages:
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
@@ -123,15 +127,82 @@ ${gen_package_props(packages)}\
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
% endif
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetName>${name}</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>${name}</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>${name}</TargetName>
+ % if "zlib" in packages:
+ <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
+ <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
+ % endif
+ % if "openssl" in packages:
+ <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
+ % endif
</PropertyGroup>
+ % if dll == 'yes':
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>${get_subsystem(project.is_library)}</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|x64'">
+ <ClCompile>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>${get_subsystem(project.is_library)}</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-DLL|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>${get_subsystem(project.is_library)}</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-DLL|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>${get_subsystem(project.is_library)}</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ % endif
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -139,6 +210,7 @@ ${gen_package_props(packages)}\
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>${get_subsystem(project.is_library)}</SubSystem>
@@ -152,6 +224,7 @@ ${gen_package_props(packages)}\
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>${get_subsystem(project.is_library)}</SubSystem>
@@ -167,6 +240,7 @@ ${gen_package_props(packages)}\
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>${get_subsystem(project.is_library)}</SubSystem>
@@ -184,6 +258,7 @@ ${gen_package_props(packages)}\
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>${get_subsystem(project.is_library)}</SubSystem>