Skip to content

Commit

Permalink
Fixed Sharpmake resolver for extended platform names
Browse files Browse the repository at this point in the history
* also fixed the project dependency of samples projects to depend on Sharpmake.Application
  • Loading branch information
bchampoux authored and baudronp committed Jan 24, 2024
1 parent 683f614 commit f98e91b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Sharpmake.FunctionalTests/Sharpmake.FunctionalTests.csproj
Expand Up @@ -10,4 +10,8 @@
<None Include="**/*" Exclude="Sharpmake.FunctionalTests.csproj;obj/**" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sharpmake.Application\Sharpmake.Application.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions Sharpmake/Resolver.cs
Expand Up @@ -733,6 +733,12 @@ private string GetMemberStringValue(string memberPath, bool throwIfNotFound)
throw new NotFoundException(parameterName + name + " is null on target type " + refCountedReference.Value.GetType().Name + ", please set a proper value for sharpmake to resolve it");
}

// Handle platform names in case they are provided by a platform extension, this allow "[target.Platform]" to be properly resolved
if (parameter is Platform platform && platform >= Platform._reservedPlatformSection)
{
parameter = Util.GetSimplePlatformString(platform);
}

return ApplyModifier(modifier, parameter.ToString());
}

Expand Down
4 changes: 1 addition & 3 deletions samples/Samples.csproj
Expand Up @@ -16,9 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sharpmake\Sharpmake.csproj" />
<ProjectReference Include="..\Sharpmake.Platforms\Sharpmake.CommonPlatforms\Sharpmake.CommonPlatforms.csproj" />
<ProjectReference Include="..\Sharpmake.Generators\Sharpmake.Generators.csproj" />
<ProjectReference Include="..\Sharpmake.Application\Sharpmake.Application.csproj" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Expand Down

0 comments on commit f98e91b

Please sign in to comment.