Skip to content

Commit

Permalink
Regenerating project files and massaging VS project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Noble committed Jul 31, 2015
1 parent 772fb1e commit 563b8a2
Show file tree
Hide file tree
Showing 26 changed files with 866 additions and 570 deletions.
5 changes: 5 additions & 0 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@
"gpr"
],
"baselib": true,
"dll": "yes",
"filegroups": [
"grpc_base",
"census"
Expand Down Expand Up @@ -561,6 +562,7 @@
"gpr"
],
"baselib": true,
"dll": "yes",
"filegroups": [
"grpc_base",
"census"
Expand Down Expand Up @@ -590,6 +592,7 @@
"grpc"
],
"baselib": true,
"dll": "yes",
"filegroups": [
"grpc++_base"
],
Expand Down Expand Up @@ -641,6 +644,7 @@
"grpc_unsecure"
],
"baselib": true,
"dll": "yes",
"filegroups": [
"grpc++_base"
],
Expand Down Expand Up @@ -829,6 +833,7 @@
"gpr",
"grpc"
],
"dll": "only",
"vs_project_guid": "{D64C6D63-4458-4A88-AB38-35678384A7E4}"
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/buildall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cd /d %~dp0
@call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86

@rem Build the C# native extension
msbuild ..\..\vsprojects\grpc.sln /t:grpc_csharp_ext /p:PlatformToolset=v120 || goto :error
msbuild ..\..\vsprojects\grpc_csharp_ext.sln /p:PlatformToolset=v120 || goto :error

msbuild Grpc.sln /p:Configuration=Debug || goto :error
msbuild Grpc.sln /p:Configuration=Release || goto :error
Expand Down
4 changes: 2 additions & 2 deletions templates/vsprojects/grpc.sln.template
Original file line number Diff line number Diff line change
@@ -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)}
${gen_solution(solution_projects, use_dlls='yes')}
5 changes: 5 additions & 0 deletions templates/vsprojects/grpc_csharp_ext.sln.template
Original file line number Diff line number Diff line change
@@ -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')}
Original file line number Diff line number Diff line change
@@ -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'])}
56 changes: 55 additions & 1 deletion templates/vsprojects/sln_defs.include
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
145 changes: 110 additions & 35 deletions templates/vsprojects/vcxproj_defs.include
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -123,22 +127,90 @@ ${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>
<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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down
Loading

0 comments on commit 563b8a2

Please sign in to comment.