From 563b8a2779d2887e5030672cdeb3122aaca8b376 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Thu, 30 Jul 2015 15:39:43 -0700 Subject: Regenerating project files and massaging VS project files. --- templates/vsprojects/grpc.sln.template | 4 +- templates/vsprojects/grpc_csharp_ext.sln.template | 5 + .../grpc_csharp_ext.vcxproj.template | 2 +- templates/vsprojects/sln_defs.include | 56 +++++++- templates/vsprojects/vcxproj_defs.include | 145 ++++++++++++++++----- 5 files changed, 173 insertions(+), 39 deletions(-) create mode 100644 templates/vsprojects/grpc_csharp_ext.sln.template (limited to 'templates') 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') %>\ ${gen_package_props(packages)}\ +% if dll == 'yes': + + Debug-DLL + Win32 + + + Debug-DLL + x64 + + + Release-DLL + Win32 + + + Release-DLL + x64 + +% endif Debug Win32 @@ -63,57 +83,41 @@ ${gen_package_props(packages)}\ v120 - + ${configuration_type} true Unicode - + ${configuration_type} - true + false + true Unicode - +% if dll == 'yes': + ${configuration_type} - false - true + true Unicode - + ${configuration_type} false true Unicode +% endif - - - % for prop in props: - - % endfor - - - - % for prop in props: - - % endfor - - - - % for prop in props: - - % endfor - - + % for prop in props: % endfor - + ${name} % if "zlib" in packages: static @@ -123,15 +127,82 @@ ${gen_package_props(packages)}\ Debug % endif - - ${name} - - - ${name} - - + ${name} + % if "zlib" in packages: + static + Debug + % endif + % if "openssl" in packages: + Debug + % endif + % if dll == 'yes': + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + ${get_subsystem(project.is_library)} + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + ${get_subsystem(project.is_library)} + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + + + ${get_subsystem(project.is_library)} + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + + + ${get_subsystem(project.is_library)} + true + true + true + + + % endif NotUsing @@ -139,6 +210,7 @@ ${gen_package_props(packages)}\ Disabled WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) true + MultiThreadedDebug ${get_subsystem(project.is_library)} @@ -152,6 +224,7 @@ ${gen_package_props(packages)}\ Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreadedDebug ${get_subsystem(project.is_library)} @@ -167,6 +240,7 @@ ${gen_package_props(packages)}\ true WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) true + MultiThreaded ${get_subsystem(project.is_library)} @@ -184,6 +258,7 @@ ${gen_package_props(packages)}\ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true + MultiThreaded ${get_subsystem(project.is_library)} -- cgit v1.2.3