OLD | NEW |
(Empty) | |
| 1 <%namespace file="packages.include" import="gen_package_props,gen_package_targe
ts,gen_package_ensure"/>\ |
| 2 <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ |
| 3 <%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}
</%def>\ |
| 4 <%def name="item_definition_group(project, target, debug, dll, _64bit)">\ |
| 5 <% |
| 6 repo_root = '$(SolutionDir)\..' |
| 7 %>\ |
| 8 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='${'%s%s|%s' %
('Debug' if debug else 'Release', '-DLL' if dll else '', 'x64' if _64bit else '
Win32')}'"> |
| 9 <ClCompile> |
| 10 <PrecompiledHeader>NotUsing</PrecompiledHeader> |
| 11 <WarningLevel>Level3</WarningLevel> |
| 12 <Optimization>${'Disabled' if debug else 'MaxSpeed'}</Optimization> |
| 13 <PreprocessorDefinitions>WIN32;${'_DEBUG' if debug else 'NDEBUG'};_LIB;%(P
reprocessorDefinitions)</PreprocessorDefinitions> |
| 14 % if not debug: |
| 15 <FunctionLevelLinking>true</FunctionLevelLinking> |
| 16 <IntrinsicFunctions>true</IntrinsicFunctions> |
| 17 % endif |
| 18 <SDLCheck>true</SDLCheck> |
| 19 <RuntimeLibrary>${'MultiThreadedDebug' if debug else 'MultiThreaded'}</Run
timeLibrary> |
| 20 <TreatWarningAsError>${'false' if target.boringssl else 'true'}</TreatWarn
ingAsError> |
| 21 <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationForma
t> |
| 22 ## Silence D9007 warning. See #4508 |
| 23 <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
| 24 </ClCompile> |
| 25 <Link> |
| 26 <SubSystem>${get_subsystem(project.is_library)}</SubSystem> |
| 27 <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInfor
mation> |
| 28 <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInfor
mation> |
| 29 % if project.get("noentry", False): |
| 30 <NoEntryPoint>true</NoEntryPoint> |
| 31 % endif |
| 32 % if project.get("dll_def", None): |
| 33 <ModuleDefinitionFile>${repo_root}\${to_windows_path(project.dll_def)}</Mo
duleDefinitionFile> |
| 34 % endif |
| 35 % if not debug: |
| 36 <EnableCOMDATFolding>true</EnableCOMDATFolding> |
| 37 <OptimizeReferences>true</OptimizeReferences> |
| 38 % endif |
| 39 </Link> |
| 40 </ItemDefinitionGroup> |
| 41 </%def>\ |
| 42 <%def name="gen_project(name, collection)">\ |
| 43 <% |
| 44 target = None |
| 45 for p in vsprojects: |
| 46 if p.name == name: |
| 47 project = p |
| 48 for t in collection: |
| 49 if t.name == name: |
| 50 target = t |
| 51 props = project.vs_props |
| 52 packages = project.vs_packages |
| 53 configuration_type = project.vs_config_type |
| 54 project_guid = project.vs_project_guid |
| 55 if target.build == 'test' and target.language == 'c++': |
| 56 props.extend(['cpptest']) |
| 57 if configuration_type == 'Application': |
| 58 if target.build == 'protoc': |
| 59 props.extend(['protoc', 'protobuf']) |
| 60 else: |
| 61 if target.language == 'c++': |
| 62 props.extend(['protobuf']) |
| 63 props.extend(['winsock', 'zlib']) |
| 64 packages.extend(['grpc.dependencies.zlib']) |
| 65 if target.get('secure', 'check'): |
| 66 props.extend(['openssl']) |
| 67 packages.extend(['grpc.dependencies.openssl']) |
| 68 else: |
| 69 props.extend(['winsock']) |
| 70 props.extend(['global']) |
| 71 props = sorted(list(set(props))) |
| 72 packages = sorted(list(set(packages))) |
| 73 dll = project.get('dll', False) |
| 74 repo_root = '$(SolutionDir)\..' |
| 75 %>\ |
| 76 <?xml version="1.0" encoding="utf-8"?> |
| 77 <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.micros
oft.com/developer/msbuild/2003"> |
| 78 ${gen_package_props(packages, repo_root)}\ |
| 79 <ItemGroup Label="ProjectConfigurations"> |
| 80 % if dll and dll != 'only': |
| 81 <ProjectConfiguration Include="Debug-DLL|Win32"> |
| 82 <Configuration>Debug-DLL</Configuration> |
| 83 <Platform>Win32</Platform> |
| 84 </ProjectConfiguration> |
| 85 <ProjectConfiguration Include="Debug-DLL|x64"> |
| 86 <Configuration>Debug-DLL</Configuration> |
| 87 <Platform>x64</Platform> |
| 88 </ProjectConfiguration> |
| 89 <ProjectConfiguration Include="Release-DLL|Win32"> |
| 90 <Configuration>Release-DLL</Configuration> |
| 91 <Platform>Win32</Platform> |
| 92 </ProjectConfiguration> |
| 93 <ProjectConfiguration Include="Release-DLL|x64"> |
| 94 <Configuration>Release-DLL</Configuration> |
| 95 <Platform>x64</Platform> |
| 96 </ProjectConfiguration> |
| 97 % endif |
| 98 <ProjectConfiguration Include="Debug|Win32"> |
| 99 <Configuration>Debug</Configuration> |
| 100 <Platform>Win32</Platform> |
| 101 </ProjectConfiguration> |
| 102 <ProjectConfiguration Include="Debug|x64"> |
| 103 <Configuration>Debug</Configuration> |
| 104 <Platform>x64</Platform> |
| 105 </ProjectConfiguration> |
| 106 <ProjectConfiguration Include="Release|Win32"> |
| 107 <Configuration>Release</Configuration> |
| 108 <Platform>Win32</Platform> |
| 109 </ProjectConfiguration> |
| 110 <ProjectConfiguration Include="Release|x64"> |
| 111 <Configuration>Release</Configuration> |
| 112 <Platform>x64</Platform> |
| 113 </ProjectConfiguration> |
| 114 </ItemGroup> |
| 115 <PropertyGroup Label="Globals"> |
| 116 <ProjectGuid>${project_guid if project_guid else project.vs_project_guid}</P
rojectGuid> |
| 117 ## Silence MSB8029 warning. See #4506 |
| 118 <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> |
| 119 ## Use different location for intermediate directory to make path shorter than 2
60 characters. |
| 120 <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> |
| 121 </PropertyGroup> |
| 122 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
| 123 <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configura
tion"> |
| 124 <PlatformToolset>v100</PlatformToolset> |
| 125 </PropertyGroup> |
| 126 <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configura
tion"> |
| 127 <PlatformToolset>v110</PlatformToolset> |
| 128 </PropertyGroup> |
| 129 <PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configura
tion"> |
| 130 <PlatformToolset>v120</PlatformToolset> |
| 131 </PropertyGroup> |
| 132 <PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configura
tion"> |
| 133 <PlatformToolset>v140</PlatformToolset> |
| 134 </PropertyGroup> |
| 135 <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> |
| 136 <ConfigurationType>${configuration_type}</ConfigurationType> |
| 137 <UseDebugLibraries>true</UseDebugLibraries> |
| 138 <CharacterSet>Unicode</CharacterSet> |
| 139 </PropertyGroup> |
| 140 <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"
> |
| 141 <ConfigurationType>${configuration_type}</ConfigurationType> |
| 142 <UseDebugLibraries>false</UseDebugLibraries> |
| 143 <WholeProgramOptimization>true</WholeProgramOptimization> |
| 144 <CharacterSet>Unicode</CharacterSet> |
| 145 </PropertyGroup> |
| 146 % if dll and dll != 'only': |
| 147 <PropertyGroup Condition="'$(Configuration)'=='Debug-DLL'" Label="Configuratio
n"> |
| 148 <ConfigurationType>${configuration_type}</ConfigurationType> |
| 149 <UseDebugLibraries>true</UseDebugLibraries> |
| 150 <CharacterSet>Unicode</CharacterSet> |
| 151 </PropertyGroup> |
| 152 <PropertyGroup Condition="'$(Configuration)'=='Release-DLL'" Label="Configurat
ion"> |
| 153 <ConfigurationType>${configuration_type}</ConfigurationType> |
| 154 <UseDebugLibraries>false</UseDebugLibraries> |
| 155 <WholeProgramOptimization>true</WholeProgramOptimization> |
| 156 <CharacterSet>Unicode</CharacterSet> |
| 157 </PropertyGroup> |
| 158 % endif |
| 159 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
| 160 <ImportGroup Label="ExtensionSettings"> |
| 161 </ImportGroup> |
| 162 <ImportGroup Label="PropertySheets"> |
| 163 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condit
ion="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="Local
AppDataPlatform" /> |
| 164 % for prop in props: |
| 165 <Import Project="${repo_root}\vsprojects\${prop}.props" /> |
| 166 % endfor |
| 167 </ImportGroup> |
| 168 <PropertyGroup Label="UserMacros" /> |
| 169 % for config in ['Debug', 'Release']:# + (['Debug-DLL', 'Release-DLL'] if dll an
d dll != 'only' else []): |
| 170 <PropertyGroup Condition="'$(Configuration)'=='${config}'"> |
| 171 <TargetName>${name}</TargetName> |
| 172 % for package in vspackages: |
| 173 % if packages == 'all' or package.name in packages: |
| 174 % if package.get('linkage', None) is not None: |
| 175 <Linkage-${package.name.replace('.', '_')}>${package.linkage}</Linkage-${pac
kage.name.replace('.', '_')}> |
| 176 % endif |
| 177 <Configuration-${package.name.replace('.', '_')}>${config}</Configuration-${
package.name.replace('.', '_')}> |
| 178 % endif |
| 179 % endfor |
| 180 </PropertyGroup> |
| 181 % endfor |
| 182 % if dll and dll != 'only': |
| 183 ${item_definition_group(project, target, True, True, False)} |
| 184 ${item_definition_group(project, target, True, True, True)} |
| 185 ${item_definition_group(project, target, False, True, False)} |
| 186 ${item_definition_group(project, target, False, True, True)} |
| 187 % endif |
| 188 ${item_definition_group(project, target, True, False, False)} |
| 189 ${item_definition_group(project, target, True, False, True)} |
| 190 ${item_definition_group(project, target, False, False, False)} |
| 191 ${item_definition_group(project, target, False, False, True)} |
| 192 % if project.get('public_headers',[]): |
| 193 <ItemGroup> |
| 194 % for public_header in project.public_headers: |
| 195 <ClInclude Include="${repo_root}\${to_windows_path(public_header)}" /> |
| 196 % endfor |
| 197 </ItemGroup> |
| 198 % endif |
| 199 % if project.get('headers',[]): |
| 200 <ItemGroup> |
| 201 % for header in project.headers: |
| 202 <ClInclude Include="${repo_root}\${to_windows_path(header)}" /> |
| 203 % endfor |
| 204 </ItemGroup> |
| 205 % endif |
| 206 % if project.get('dll_def', None): |
| 207 <ItemGroup> |
| 208 <None Include="${repo_root}\${to_windows_path(project.dll_def)}" /> |
| 209 </ItemGroup> |
| 210 % endif |
| 211 % if project.get('src',[]): |
| 212 <ItemGroup> |
| 213 % for src_name in project.src: |
| 214 % if src_name.endswith(".proto"): |
| 215 <% src_name_parts = src_name.split(".") %>\ |
| 216 <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.
cc")}"> |
| 217 </ClCompile> |
| 218 <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.
h")}"> |
| 219 </ClInclude> |
| 220 <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grp
c.pb.cc")}"> |
| 221 </ClCompile> |
| 222 <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grp
c.pb.h")}"> |
| 223 </ClInclude> |
| 224 % else: |
| 225 <ClCompile Include="${repo_root}\${to_windows_path(src_name)}"> |
| 226 </ClCompile> |
| 227 % endif |
| 228 % endfor |
| 229 </ItemGroup> |
| 230 % elif configuration_type != 'StaticLibrary': |
| 231 <ItemGroup> |
| 232 <ClCompile Include="${repo_root}\${to_windows_path('vsprojects/dummy.c')}"> |
| 233 </ClCompile> |
| 234 </ItemGroup> |
| 235 % endif |
| 236 % if project.get('deps',[]): |
| 237 <ItemGroup> |
| 238 % for dep in project.deps: |
| 239 <ProjectReference Include="${repo_root}\vsprojects\vcxproj\${vsproject_dict[
dep].vs_proj_dir}\${dep}\${dep}.vcxproj"> |
| 240 <Project>${vsproject_dict[dep].vs_project_guid}</Project> |
| 241 </ProjectReference> |
| 242 % endfor |
| 243 </ItemGroup> |
| 244 % endif |
| 245 %if packages: |
| 246 <ItemGroup> |
| 247 <None Include="packages.config" /> |
| 248 </ItemGroup> |
| 249 %endif |
| 250 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| 251 <ImportGroup Label="ExtensionTargets"> |
| 252 ${gen_package_targets(packages, repo_root)}\ |
| 253 </ImportGroup> |
| 254 ${gen_package_ensure(packages, repo_root)}\ |
| 255 </Project> |
| 256 </%def>\ |
OLD | NEW |