Skip to content

Commit

Permalink
Create a simple minimal MSBuild front-end (dotnet/coreclr#27778)
Browse files Browse the repository at this point in the history
* Implement simple coreclr.proj msbuild entrypoint for building the coreclr product in the common configuration.

* Add dummy targets and automatically emit the enforcePGO argument when applicable.

* Add officialbuildId and stripSymbols arguments.

* Always pass the -stripsymbols argument.


Commit migrated from dotnet/coreclr@f1c282b
  • Loading branch information
jkoritzinsky authored Nov 10, 2019
1 parent 8f794d7 commit ab7a6f3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/coreclr/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ initTargetDistroRid()
# Only pass ROOTFS_DIR if cross is specified.
if (( ${__CrossBuild} == 1 )); then
passedRootfsDir=${ROOTFS_DIR}
elif [ "${__BuildArch}" != "${__HostArch}" ]; then
echo "Error, you are building a cross scenario without passing -cross."
exit 1
fi

initDistroRidGlobal ${__BuildOS} ${__BuildArch} ${__PortableBuild} ${passedRootfsDir}
Expand Down Expand Up @@ -1037,6 +1034,10 @@ while :; do
shift
done

if [ "${__BuildArch}" != "${__HostArch}" ]; then
__CrossBuild=1
fi

__CommonMSBuildArgs="/p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__BuildOS=$__BuildOS /nodeReuse:false $__OfficialBuildIdArg $__SignTypeArg $__SkipRestoreArg"

# Configure environment if we are doing a verbose build
Expand Down
27 changes: 27 additions & 0 deletions src/coreclr/coreclr.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<Import Project="Directory.Build.props" />
<Import Project="Directory.Build.targets" />

<Target Name="Build">
<ItemGroup>
<_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="-skiptests" />
<_CoreClrBuildArg Include="-$(Platform)" />
<_CoreClrBuildArg Include="-$(Configuration.ToLower())" />
<_CoreClrBuildArg Condition="'$(ContinuousIntegrationBuild)' == 'true'" Include="-ci" />
<_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows)) and ('$(Platform)' == 'x86' or '$(Platform)' = 'x64') and '$(Configuration)' == 'Release'" Include="-enforcepgo" />
<_CoreClrBuildArg Condition="'$(Configuration)' == 'Release'" Include="-stripsymbols" />
<_CoreClrBuildArg Condition="'$(OfficialBuildId)' == ''" Include="-officialbuildid=$(OfficialBuildId)" />
</ItemGroup>

<PropertyGroup>
<_CoreClrBuildScript Condition="$([MSBuild]::IsOsPlatform(Windows))">build.cmd</_CoreClrBuildScript>
<_CoreClrBuildScript Condition="!$([MSBuild]::IsOsPlatform(Windows))">build.sh</_CoreClrBuildScript>
</PropertyGroup>

<Exec Command="&quot;$(MSBuildThisFileDirectory)$(_CoreClrBuildScript)&quot; @(_CoreClrBuildArg->'%(Identity)',' ')" />
</Target>

<Target Name="Restore" />
<Target Name="Test" />
<Target Name="Pack" />
</Project>

0 comments on commit ab7a6f3

Please sign in to comment.