Skip to content

Commit

Permalink
Fix rc compilation with external includes, we now always use the incl…
Browse files Browse the repository at this point in the history
…udes prefixed with the default prefix
  • Loading branch information
belkiss committed Aug 14, 2021
1 parent 1bca8c6 commit 97c6212
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Sharpmake.Generators/FastBuild/Bff.cs
Expand Up @@ -1455,18 +1455,10 @@ private static void FillIncludeDirectoriesOptions(BffGenerationContext context)
var resourceDirs = new List<string>();
resourceDirs.AddRange(resourceIncludePaths.Select(p => CmdLineConvertIncludePathsFunc(context, context.EnvironmentVariableResolver, p, defaultCmdLineIncludePrefix)));

if (Options.GetObject<Options.Vc.General.PlatformToolset>(context.Configuration).IsLLVMToolchain() &&
Options.GetObject<Options.Vc.LLVM.UseClangCl>(context.Configuration) == Options.Vc.LLVM.UseClangCl.Enable)
{
// with LLVM as toolchain, we are still using the default resource compiler, so we need the default include prefix
// TODO: this is not great, ideally we would need the prefix to be per "compiler", and a platform can have many
var platformIncludePathsDefaultPrefix = platformIncludePaths.Select(p => CmdLineConvertIncludePathsFunc(context, context.EnvironmentVariableResolver, p.Path, defaultCmdLineIncludePrefix));
resourceDirs.AddRange(platformIncludePathsDefaultPrefix);
}
else
{
resourceDirs.AddRange(platformIncludePathsPrefixed);
}
// with LLVM as toolchain, we are still using the default resource compiler, so we need the default include prefix
// TODO: this is not great, ideally we would need the prefix to be per "compiler", and a platform can have many
var platformIncludePathsDefaultPrefix = platformIncludePaths.Select(p => CmdLineConvertIncludePathsFunc(context, context.EnvironmentVariableResolver, p.Path, defaultCmdLineIncludePrefix));
resourceDirs.AddRange(platformIncludePathsDefaultPrefix);

if (resourceDirs.Any())
context.CommandLineOptions["AdditionalResourceIncludeDirectories"] = string.Join($"'{Environment.NewLine} + ' ", resourceDirs);
Expand Down

0 comments on commit 97c6212

Please sign in to comment.