diff options
Diffstat (limited to 'templates')
23 files changed, 186 insertions, 716 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 850404baad..f9e9f846f9 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -136,6 +136,8 @@ add_definitions(/wd4065 /wd4506) # TODO(jtattermusch): revisit C4267 occurrences throughout the code add_definitions(/wd4267) + # TODO(jtattermusch): needed to build boringssl with VS2017, revisit later + add_definitions(/wd4987 /wd4774 /wd4819 /wd4996 /wd4619) endif() if (gRPC_USE_PROTO_LITE) diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index cfc13cf4dd..616f2cbbff 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -178,4 +178,9 @@ 'test/core/util/port.c', 'test/core/util/port_server_client.{c,h}' end + + # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path? + s.prepare_command = <<-END_OF_COMMAND + find src/core/ -type f -exec sed -E -i '.back' 's;#include "third_party/nanopb/(.*)";#include <nanopb/\\1>;g' {} \\\; + END_OF_COMMAND end diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 62a6d37c3c..5c92f9f9c4 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -42,12 +42,9 @@ s.header_dir = name src_dir = 'src/objective-c/GRPCClient' - s.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" - s.private_header_files = "#{src_dir}/private/*.h" - s.header_mappings_dir = "#{src_dir}" - s.dependency 'gRPC-Core', version s.dependency 'gRPC-RxLibrary', version + s.default_subspec = 'Main' # Certificates, to be able to establish TLS connections: s.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] } @@ -56,4 +53,22 @@ # This is needed by all pods that depend on gRPC-RxLibrary: 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', } + + s.subspec 'Main' do |ss| + ss.header_mappings_dir = "#{src_dir}" + + ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}" + ss.exclude_files = "#{src_dir}/GRPCCall+GID.{h,m}" + ss.private_header_files = "#{src_dir}/private/*.h" + + ss.dependency 'gRPC-Core', version + end + + s.subspec 'GID' do |ss| + ss.header_mappings_dir = "#{src_dir}" + + ss.source_files = "#{src_dir}/GRPCCall+GID.{h,m}" + + ss.dependency 'Google/SignIn' + end end diff --git a/templates/grpc.gyp.template b/templates/grpc.gyp.template new file mode 100644 index 0000000000..3363082a83 --- /dev/null +++ b/templates/grpc.gyp.template @@ -0,0 +1,157 @@ +%YAML 1.2 +--- | + # GRPC GYP build file + + # This file has been automatically generated from a template file. + # Please look at the templates directory instead. + # This file can be regenerated from the template by running + # tools/buildgen/generate_projects.sh + + # Copyright 2015 gRPC authors. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + { + 'variables': { + # The openssl and zlib dependencies must be passed in as variables + # defined in an included gypi file, usually common.gypi. + 'openssl_gyp_target%': 'Please Define openssl_gyp_target variable', + 'zlib_gyp_target%': 'Please Define zlib_gyp_target variable', + + 'grpc_gcov%': 'false', + 'grpc_alpine%': 'false', + }, + 'target_defaults': { + 'configurations': { + % for name, args in configs.iteritems(): + % if name in ['dbg', 'opt']: + '${{'dbg':'Debug', 'opt': 'Release'}[name]}': { + % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines')]: + % if args.get(arg, None) is not None: + '${prop}': [ + % for item in args.get(arg).split(): + '${item}', + % endfor + ], + % endif + % endfor + }, + % endif + % endfor + }, + % for arg, prop in [('CPPFLAGS', 'cflags'), ('LDFLAGS', 'ldflags')]: + % if defaults['global'].get(arg, None) is not None: + '${prop}': [ + % for item in defaults['global'].get(arg).split(): + '${item}', + % endfor + ], + % endif + % endfor + 'cflags_c': [ + '-Werror', + '-std=c99' + ], + 'cflags_cc': [ + '-Werror', + '-std=c++11' + ], + 'include_dirs': [ + '.', + '../..', + 'include', + ], + 'defines': [ + 'GRPC_ARES=0', + ], + 'dependencies': [ + '<(openssl_gyp_target)', + '<(zlib_gyp_target)', + ], + 'conditions': [ + ['grpc_gcov=="true"', { + % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines'), ('LDFLAGS', 'ldflags')]: + % if configs['gcov'].get(arg, None) is not None: + '${prop}': [ + % for item in configs['gcov'].get(arg).split(): + '${item}', + % endfor + ], + % endif + % endfor + }], + ['grpc_alpine=="true"', { + 'defines': [ + 'GPR_MUSL_LIBC_COMPAT' + ] + }], + ['OS == "win"', { + 'defines': [ + '_WIN32_WINNT=0x0600', + 'WIN32_LEAN_AND_MEAN', + '_HAS_EXCEPTIONS=0', + 'UNICODE', + '_UNICODE', + 'NOMINMAX', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 1, # static debug + } + }, + "libraries": [ + "ws2_32" + ] + }], + ['OS == "mac"', { + 'xcode_settings': { + % if defaults['global'].get('CPPFLAGS', None) is not None: + 'OTHER_CFLAGS': [ + % for item in defaults['global'].get('CPPFLAGS').split(): + '${item}', + % endfor + ], + 'OTHER_CPLUSPLUSFLAGS': [ + % for item in defaults['global'].get('CPPFLAGS').split(): + '${item}', + % endfor + '-stdlib=libc++', + '-std=c++11', + '-Wno-error=deprecated-declarations' + ], + % endif + }, + }] + ] + }, + 'targets': [ + % for lib in libs: + % if getattr(lib, 'platforms', None) is None and lib.name != 'ares': + { + 'target_name': '${lib.name}', + 'type': 'static_library', + 'dependencies': [ + % for dep in getattr(lib, 'deps', []): + '${dep}', + % endfor + ], + 'sources': [ + % for source in lib.src: + '${source}', + % endfor + ], + }, + % endif + % endfor + ] + } diff --git a/templates/package.xml.template b/templates/package.xml.template index 27cc4d01a9..15da704a47 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -24,13 +24,9 @@ </stability> <license>Apache 2.0</license> <notes> - - Fixed some memory leaks #9559, #10996 - - Disabled cares dependency from gRPC C Core #10940 - - De-coupled protobuf dependency #11112 - - Fixed extension reported version #10842 - - Added config.w32 for Windows support #8161 - - Fixed PHP distrib test after cc files were added #11193 - - Fixed protoc plugin comment escape bug #11025 + - Channel are now by default persistent #11878 + - Some bug fixes from 1.4 branch #12109, #12123 + - Fixed hang bug when fork() was used #11814 </notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/templates/vsprojects/build_test_protos.sh b/templates/vsprojects/build_test_protos.sh deleted file mode 100644 index ef6f786bfd..0000000000 --- a/templates/vsprojects/build_test_protos.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -GRPC_CPP_PLUGIN_PATH=`which grpc_cpp_plugin` - -cd `dirname $0`/../.. - -find ./test -type f -name "*.proto" | -while read p ; do - echo "processing $p" - DIR=$(dirname "$p") - protoc $p --grpc_out=./ --plugin=protoc-gen-grpc=$GRPC_CPP_PLUGIN_PATH - protoc $p --cpp_out=./ -done diff --git a/templates/vsprojects/buildtests_c.sln.template b/templates/vsprojects/buildtests_c.sln.template deleted file mode 100644 index 9b18c7445d..0000000000 --- a/templates/vsprojects/buildtests_c.sln.template +++ /dev/null @@ -1,13 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="sln_defs.include" import="gen_solution"/>\ - <% - solution_projects = [ - p for p in vsprojects - if p.build in ['test', 'tool'] - and p.language == 'c' - and not p.boringssl - and not p.zlib - ] - %>\ - ${gen_solution(solution_projects, use_dlls='yes')} diff --git a/templates/vsprojects/cpptest.props.template b/templates/vsprojects/cpptest.props.template deleted file mode 100644 index 14169d6ddf..0000000000 --- a/templates/vsprojects/cpptest.props.template +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ImportGroup Label="PropertySheets" /> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup /> - <ItemDefinitionGroup> - <ClCompile> - <AdditionalIncludeDirectories>$(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;$(SolutionDir)\..\third_party\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <WarningLevel>EnableAllWarnings</WarningLevel> - </ClCompile> - <Link> - <AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gpr_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;gpr.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\gtest\msvc\gtest\Debug;$(SolutionDir)\..\third_party\gflags\lib\Debug;$(SolutionDir)\..\Debug;$(SolutionDir)\..\packages\grpc.dependencies.openssl.${vspackages_dict['grpc.dependencies.openssl'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemGroup /> -</Project> diff --git a/templates/vsprojects/global.props.template b/templates/vsprojects/global.props.template deleted file mode 100644 index c53e4f16e3..0000000000 --- a/templates/vsprojects/global.props.template +++ /dev/null @@ -1,22 +0,0 @@ -%YAML 1.2 ---- | - <?xml version="1.0" encoding="utf-8"?> - <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ImportGroup Label="PropertySheets" /> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <Jenkins>false</Jenkins> - </PropertyGroup> - <ItemDefinitionGroup> - <ClCompile> - <AdditionalIncludeDirectories>$(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;${';'.join('$(SolutionDir)\\packages\\%s.%s\\build\\native\\include' % (p.name, p.version) for p in vspackages)};%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_WIN32_WINNT=0x600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <WarningLevel>EnableAllWarnings</WarningLevel> - </ClCompile> - <Link> - <!-- LNK4271 pollutes test output. See #4521 --> - <AdditionalOptions>/ignore:4217 %(AdditionalOptions)</AdditionalOptions> - </Link> - </ItemDefinitionGroup> - <ItemGroup /> - </Project> diff --git a/templates/vsprojects/grpc.sln.template b/templates/vsprojects/grpc.sln.template deleted file mode 100644 index 0b28e936be..0000000000 --- a/templates/vsprojects/grpc.sln.template +++ /dev/null @@ -1,7 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="sln_defs.include" import="gen_solution"/>\ - <% - solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test', 'fuzzer'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++') and not p.name in ['z', 'boringssl', 'grpc++_reflection']] - %>\ - ${gen_solution(solution_projects, use_dlls='yes')} diff --git a/templates/vsprojects/grpc_csharp_ext.sln.template b/templates/vsprojects/grpc_csharp_ext.sln.template deleted file mode 100644 index 9b09f5ef28..0000000000 --- a/templates/vsprojects/grpc_csharp_ext.sln.template +++ /dev/null @@ -1,7 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="sln_defs.include" import="gen_solution"/>\ - <% - solution_projects = [p for p in vsprojects if p.build == 'all' and p.language == 'csharp'] - %>\ - ${gen_solution(solution_projects, use_dlls='only')} diff --git a/templates/vsprojects/grpc_protoc_plugins.sln.template b/templates/vsprojects/grpc_protoc_plugins.sln.template deleted file mode 100644 index 06f182b601..0000000000 --- a/templates/vsprojects/grpc_protoc_plugins.sln.template +++ /dev/null @@ -1,7 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="sln_defs.include" import="gen_solution"/>\ - <% - solution_projects = [p for p in vsprojects if p.build == 'protoc'] - %>\ - ${gen_solution(solution_projects)} diff --git a/templates/vsprojects/openssl.props.template b/templates/vsprojects/openssl.props.template deleted file mode 100644 index 32c3604405..0000000000 --- a/templates/vsprojects/openssl.props.template +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ImportGroup Label="PropertySheets" />
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup />
- <ItemDefinitionGroup>
- <Link>
- <AdditionalDependencies>ssleay32.lib;libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.openssl.${vspackages_dict['grpc.dependencies.openssl'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup />
-</Project>
diff --git a/templates/vsprojects/packages.include b/templates/vsprojects/packages.include deleted file mode 100644 index f3c57634f9..0000000000 --- a/templates/vsprojects/packages.include +++ /dev/null @@ -1,53 +0,0 @@ -<%def name="get_name(vspackages, package)">${''.join('%s.%s' % (p.name, p.version) for p in vspackages if p.name == package)}</%def> -<%def name="gen_packages_config(packages)">\ -<?xml version="1.0" encoding="utf-8"?> -<packages> - % for package in vspackages: - % if packages == 'all' or package.name in packages: - <package id="${package.name}" version="${package.version}" targetFramework="Native" /> - % if package.redist: - <package id="${package.name}.redist" version="${package.version}" targetFramework="Native" /> - % endif - % endif - % endfor -</packages> -</%def>\ -<%def name="gen_package_props(packages, repo_root)">\ - % for package in vspackages: - % if packages == 'all' or package.name in packages: - % if package.props: - <Import Project="${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.name}.props" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.version}.props')" /> - % endif - % endif - % endfor -</%def>\ -<%def name="gen_package_targets(packages, repo_root)">\ - % for package in vspackages: - % if packages == 'all' or package.name in packages: - % if package.redist: - <Import Project="${repo_root}\vsprojects\packages\${package.name}.redist.${package.version}\build\native\${package.name}.redist.targets" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.redist.${package.version}\build\native\grpc.dependencies\${package.name}.targets')" /> - % endif - <Import Project="${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.name}.targets" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\grpc.dependencies\${package.name}.targets')" /> - % endif - % endfor -</%def>\ -<%def name="check_file_inner(file)"><Error Condition="!Exists('${file}')" Text="$([System.String]::Format('$(ErrorText)', '${file}')" /></%def>\ -<%def name="check_file(file, repo_root, package)">${check_file_inner(file % {'root':repo_root, 'name':package.name, 'version':package.version})}</%def>\ -<%def name="gen_package_ensure(packages, repo_root)">\ - <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> - <PropertyGroup> - <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> - </PropertyGroup> - % for package in vspackages: - % if packages == 'all' or package.name in packages: - % if package.redist: - ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.redist.%(version)s\\build\\native\\%(name)s.redist.targets', repo_root, package)} - % endif - % if package.props: - ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.%(version)s\\build\\native\\%(name)s.props', repo_root, package)} - % endif - ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.%(version)s\\build\\native\\%(name)s.targets', repo_root, package)} - % endif - % endfor - </Target> -</%def>\ diff --git a/templates/vsprojects/protobuf.props.template b/templates/vsprojects/protobuf.props.template deleted file mode 100644 index 3ae7c745de..0000000000 --- a/templates/vsprojects/protobuf.props.template +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ImportGroup Label="PropertySheets" />
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup />
- <ItemDefinitionGroup>
- <Link>
- <AdditionalDependencies>libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup />
-</Project>
diff --git a/templates/vsprojects/protoc.props.template b/templates/vsprojects/protoc.props.template deleted file mode 100644 index 65771fc5a3..0000000000 --- a/templates/vsprojects/protoc.props.template +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ImportGroup Label="PropertySheets" />
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup />
- <ItemDefinitionGroup>
- <ClCompile>
- <DisableSpecificWarnings>4244;4267;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup />
-</Project>
diff --git a/templates/vsprojects/sln_defs.include b/templates/vsprojects/sln_defs.include deleted file mode 100644 index cc525781a0..0000000000 --- a/templates/vsprojects/sln_defs.include +++ /dev/null @@ -1,119 +0,0 @@ -<%def name="gen_solution(solution_top_level_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 -## the file. - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -<% -## Visual Studio uses GUIDs for project types -## http://msdn.microsoft.com/en-us/library/hb23x61k%28v=vs.80%29.aspx -cpp_proj_type = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" - -all_projects = set() -for project in solution_top_level_projects: - for dep in project.deps: - all_projects.add(dep) - all_projects.add(project.name) - -solution_projects = [vsproject_dict[project] for project in sorted(list(all_projects))] -%>\ -% for project in solution_projects: -Project("${cpp_proj_type}") = "${project.name}", "vcxproj\${project.vs_proj_dir}\${project.name}\${project.name}.vcxproj", "${project.vs_project_guid}" - ProjectSection(myProperties) = preProject - % if project.is_library: - lib = "True" - % else: - lib = "False" - % endif - EndProjectSection - % if project.get('deps', None): - ProjectSection(ProjectDependencies) = postProject - % for dep in project.get('deps', []): - ${vsproject_dict[dep].vs_project_guid} = ${vsproject_dict[dep].vs_project_guid} - % endfor - EndProjectSection - % endif -EndProject -% endfor -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', False) != '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', False) == False: - ${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', False) == True: - ${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 - ${project.vs_project_guid}.Debug|x64.Build.0 = Debug|x64 - ${project.vs_project_guid}.Release|Win32.ActiveCfg = Release|Win32 - ${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 - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -</%def>\ diff --git a/templates/vsprojects/vcxproj.filters_defs.include b/templates/vsprojects/vcxproj.filters_defs.include deleted file mode 100644 index e7df8db763..0000000000 --- a/templates/vsprojects/vcxproj.filters_defs.include +++ /dev/null @@ -1,70 +0,0 @@ -<%! - import re - import hashlib - - def calc_to_filter(path): - return '\\'.join(path.split('/')[:-1]) -%>\ -<%def name="get_repo_root(proj)">${'$(SolutionDir)\..'}</%def>\ -<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ -<%def name="to_filter(path)">${calc_to_filter(path)}</%def>\ -<%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\ -<%def name="gen_filters(name, collection)">\ -% for project in vsprojects: - % if project.name == name: -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - % if project.get('src',[]): - <ItemGroup> - % for src_name in project.src: - <ClCompile Include="${get_repo_root(project)}\${to_windows_path(src_name)}"> - <Filter>${to_filter(src_name)}</Filter> - </ClCompile> - % endfor - </ItemGroup> - % endif - % if project.get('dll_def', None): - <ItemGroup> - <None Include="${get_repo_root(project)}\${to_windows_path(project.dll_def)}" /> - </ItemGroup> - % endif - % if project.get('public_headers',[]): - <ItemGroup> - % for public_header in project.public_headers: - <ClInclude Include="${get_repo_root(project)}\${to_windows_path(public_header)}"> - <Filter>${to_filter(public_header)}</Filter> - </ClInclude> - % endfor - </ItemGroup> - % endif - % if project.get('headers',[]): - <ItemGroup> - % for header in project.headers: - <ClInclude Include="${get_repo_root(project)}\${to_windows_path(header)}"> - <Filter>${to_filter(header)}</Filter> - </ClInclude> - % endfor - </ItemGroup> - % endif -<% - filters = set() - files = project.get('src', []) + project.get('public_headers', []) + project.get('headers', []) - for file in files: - filter = calc_to_filter(file) - paths = filter.split('\\') - for i in range(len(paths)): - filters.add('\\'.join(paths[:i + 1])) - - filters = sorted(filters) -%> - <ItemGroup> - % for filter in filters: - <Filter Include="${filter}"> - <UniqueIdentifier>{${filter_to_guid(project.name, filter)}}</UniqueIdentifier> - </Filter> - % endfor - </ItemGroup> -</Project> - % endif -% endfor -</%def>\ diff --git a/templates/vsprojects/vcxproj.template b/templates/vsprojects/vcxproj.template deleted file mode 100644 index 0bb208f443..0000000000 --- a/templates/vsprojects/vcxproj.template +++ /dev/null @@ -1,20 +0,0 @@ -%YAML 1.2 ---- -foreach: vsprojects -output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj -cond: selected.build not in ['fuzzer'] -template: | - <%namespace file="vcxproj_defs.include" import="gen_project"/>\ - ${gen_project(selected.name, vsprojects)} ---- -foreach: vsprojects -output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj.filters -cond: selected.build not in ['fuzzer'] -template: | - <%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\ - ${gen_filters(selected.name, vsprojects)} ---- -output_name: grpc/packages.config -template: | - <%namespace file="packages.include" import="gen_packages_config"/>\ - ${gen_packages_config('all')} diff --git a/templates/vsprojects/vcxproj_defs.include b/templates/vsprojects/vcxproj_defs.include deleted file mode 100644 index 72a077f762..0000000000 --- a/templates/vsprojects/vcxproj_defs.include +++ /dev/null @@ -1,256 +0,0 @@ -<%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)">\ -<% - repo_root = '$(SolutionDir)\..' -%>\ - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='${'%s%s|%s' % ('Debug' if debug else 'Release', '-DLL' if dll else '', 'x64' if _64bit else 'Win32')}'"> - <ClCompile> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>${'Disabled' if debug else 'MaxSpeed'}</Optimization> - <PreprocessorDefinitions>WIN32;${'_DEBUG' if debug else 'NDEBUG'};_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> -% if not debug: - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> -% endif - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>${'MultiThreadedDebug' if debug else 'MultiThreaded'}</RuntimeLibrary> - <TreatWarningAsError>${'false' if target.boringssl else 'true'}</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> -## Silence D9007 warning. See #4508 - <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> -% if project.get("noentry", False): - <NoEntryPoint>true</NoEntryPoint> -% endif -% if project.get("dll_def", None): - <ModuleDefinitionFile>${repo_root}\${to_windows_path(project.dll_def)}</ModuleDefinitionFile> -% endif -% if not debug: - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> -% endif - </Link> - </ItemDefinitionGroup> -</%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)\..' -%>\ -<?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, repo_root)}\ - <ItemGroup Label="ProjectConfigurations"> -% if dll and dll != 'only': - <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> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>${project_guid if project_guid else project.vs_project_guid}</ProjectGuid> -## Silence MSB8029 warning. See #4506 - <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> -## Use different location for intermediate directory to make path shorter than 260 characters. - <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> - <PlatformToolset>v100</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> - <PlatformToolset>v110</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> - <PlatformToolset>v120</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> - <PlatformToolset>v140</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> - <ConfigurationType>${configuration_type}</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> - <ConfigurationType>${configuration_type}</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> -% if dll and dll != 'only': - <PropertyGroup Condition="'$(Configuration)'=='Debug-DLL'" Label="Configuration"> - <ConfigurationType>${configuration_type}</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <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"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - % for prop in props: - <Import Project="${repo_root}\vsprojects\${prop}.props" /> - % endfor - </ImportGroup> - <PropertyGroup Label="UserMacros" /> -% for config in ['Debug', 'Release']:# + (['Debug-DLL', 'Release-DLL'] if dll and dll != 'only' else []): - <PropertyGroup Condition="'$(Configuration)'=='${config}'"> - <TargetName>${name}</TargetName> - % for package in vspackages: - % if packages == 'all' or package.name in packages: - % if package.get('linkage', None) is not None: - <Linkage-${package.name.replace('.', '_')}>${package.linkage}</Linkage-${package.name.replace('.', '_')}> - % endif - <Configuration-${package.name.replace('.', '_')}>${config}</Configuration-${package.name.replace('.', '_')}> - % endif - % endfor - </PropertyGroup> -% 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',[]): - <ItemGroup> - % for public_header in project.public_headers: - <ClInclude Include="${repo_root}\${to_windows_path(public_header)}" /> - % endfor - </ItemGroup> - % endif - % if project.get('headers',[]): - <ItemGroup> - % for header in project.headers: - <ClInclude Include="${repo_root}\${to_windows_path(header)}" /> - % endfor - </ItemGroup> - % endif - % if project.get('dll_def', None): - <ItemGroup> - <None Include="${repo_root}\${to_windows_path(project.dll_def)}" /> - </ItemGroup> - % endif - % if project.get('src',[]): - <ItemGroup> - % for src_name in project.src: - % if src_name.endswith(".proto"): -<% src_name_parts = src_name.split(".") %>\ - <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.cc")}"> - </ClCompile> - <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.h")}"> - </ClInclude> - <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grpc.pb.cc")}"> - </ClCompile> - <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grpc.pb.h")}"> - </ClInclude> - % else: - <ClCompile Include="${repo_root}\${to_windows_path(src_name)}"> - </ClCompile> - % endif - % endfor - </ItemGroup> - % else: - <ItemGroup> - <ClCompile Include="${repo_root}\${to_windows_path('vsprojects/dummy.c')}"> - </ClCompile> - </ItemGroup> - % endif - % if project.get('deps',[]): - <ItemGroup> - % for dep in project.deps: - <ProjectReference Include="${repo_root}\vsprojects\vcxproj\${vsproject_dict[dep].vs_proj_dir}\${dep}\${dep}.vcxproj"> - <Project>${vsproject_dict[dep].vs_project_guid}</Project> - </ProjectReference> - % endfor - </ItemGroup> - % endif - %if packages: - <ItemGroup> - <None Include="packages.config" /> - </ItemGroup> - %endif - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> -${gen_package_targets(packages, repo_root)}\ - </ImportGroup> -${gen_package_ensure(packages, repo_root)}\ -</Project> -</%def>\ diff --git a/templates/vsprojects/winsock.props.template b/templates/vsprojects/winsock.props.template deleted file mode 100644 index 7db6731bd3..0000000000 --- a/templates/vsprojects/winsock.props.template +++ /dev/null @@ -1,14 +0,0 @@ -%YAML 1.2 ---- | - <?xml version="1.0" encoding="utf-8"?> - <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ImportGroup Label="PropertySheets" /> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup /> - <ItemDefinitionGroup> - <Link> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemGroup /> - </Project>
\ No newline at end of file diff --git a/templates/vsprojects/zlib-dll.props.template b/templates/vsprojects/zlib-dll.props.template deleted file mode 100644 index eb83ca7c0a..0000000000 --- a/templates/vsprojects/zlib-dll.props.template +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.2 ---- | - <?xml version="1.0" encoding="utf-8"?> - <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ImportGroup Label="PropertySheets" /> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup /> - <ItemDefinitionGroup> - <Link> - <AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.zlib.${vspackages_dict['grpc.dependencies.zlib'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\dynamic\cdecl;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemGroup /> - </Project> diff --git a/templates/vsprojects/zlib.props.template b/templates/vsprojects/zlib.props.template deleted file mode 100644 index d14a3942b7..0000000000 --- a/templates/vsprojects/zlib.props.template +++ /dev/null @@ -1,15 +0,0 @@ -%YAML 1.2 ---- | - <?xml version="1.0" encoding="utf-8"?> - <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ImportGroup Label="PropertySheets" /> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup /> - <ItemDefinitionGroup> - <Link> - <AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.zlib.${vspackages_dict['grpc.dependencies.zlib'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static\cdecl;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemGroup /> - </Project> |