Skip to content

Commit 9db1a29

Browse files
committed
introduce CLANG_PROFILE_PATH
1 parent 3346b9d commit 9db1a29

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

PCbuild/pyproject-clangcl.props

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
<__PyprojectClangCl_Props_Imported>true</__PyprojectClangCl_Props_Imported>
55
</PropertyGroup>
66

7+
<PropertyGroup>
8+
<!-- CLANG_PROFILE_PATH is configurable for "remote PGO builds"
9+
For convenience, we also accept paths without trailing slashes.
10+
-->
11+
<CLANG_PROFILE_PATH Condition="'$(CLANG_PROFILE_PATH)' == ''">$(OutDir)</CLANG_PROFILE_PATH>
12+
<_CLANG_PROFILE_PATH>$(CLANG_PROFILE_PATH)</_CLANG_PROFILE_PATH>
13+
<_CLANG_PROFILE_PATH Condition="!HasTrailingSlash($(_CLANG_PROFILE_PATH))">$(_CLANG_PROFILE_PATH)\</_CLANG_PROFILE_PATH>
14+
</PropertyGroup>
15+
716
<ItemGroup>
817
<_profrawFiles Include="$(OutDir)instrumented\$(TargetName)_*.profraw" />
918
</ItemGroup>
@@ -31,7 +40,7 @@
3140
<ClCompile>
3241
<AdditionalOptions>-Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>
3342
<AdditionalOptions Condition="$(Configuration) != 'Debug'">-flto %(AdditionalOptions)</AdditionalOptions>
34-
<AdditionalOptions Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">-fprofile-instr-generate=$(OutDir)$(TargetName)_%m.profraw %(AdditionalOptions)</AdditionalOptions>
43+
<AdditionalOptions Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">-fprofile-instr-generate=$(_CLANG_PROFILE_PATH)$(TargetName)_%m.profraw %(AdditionalOptions)</AdditionalOptions>
3544
<AdditionalOptions Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">-fprofile-instr-use=$(OutDir)instrumented\profdata.profdata -Wno-profile-instr-unprofiled %(AdditionalOptions)</AdditionalOptions>
3645
</ClCompile>
3746
</ItemDefinitionGroup>

PCbuild/pyproject.props

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Py_IntDir">
33
<Import Project="python.props" Condition="$(__Python_Props_Imported) != 'true'" />
4-
<Import Project="pyproject-clangcl.props" Condition="$(PlatformToolset) == 'ClangCL' and $(__PyprojectClangCl_Props_Imported) != 'true'" />
54
<PropertyGroup Label="Globals">
65
<__PyProject_Props_Imported>true</__PyProject_Props_Imported>
76
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
@@ -25,6 +24,9 @@
2524
<LinkIncremental Condition="$(Configuration) != 'Debug'">false</LinkIncremental>
2625
</PropertyGroup>
2726

27+
<!-- We need the above overridden OutDir, so this must be imported after PropertyGroup -->
28+
<Import Project="pyproject-clangcl.props" Condition="$(PlatformToolset) == 'ClangCL' and $(__PyprojectClangCl_Props_Imported) != 'true'" />
29+
2830
<PropertyGroup Condition="$(TargetExt) != ''">
2931
<TargetNameExt>$(TargetName)$(TargetExt)</TargetNameExt>
3032
<_TargetNameSep>$(TargetNameExt.LastIndexOf(`.`))</_TargetNameSep>

0 commit comments

Comments
 (0)