Skip to content

Commit

Permalink
prepare for multiple output paths
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Feb 17, 2023
1 parent acd050a commit 7ee241d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/dub/project.d
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ class Project {
case "post-build-environments":
case "pre-run-environments":
case "post-run-environments":
case "output-path":
case "output-paths":
case "default-config":
case "configs":
case "default-build":
Expand Down Expand Up @@ -1203,7 +1203,7 @@ class Project {
case "requirements": return listBuildSetting!"requirements"(args);
case "options": return listBuildSetting!"options"(args);

case "output-path": return [determineOutputPath(settings).toNativeString()];
case "output-paths": return determineOutputPaths(settings).map!"a.toNativeString".array;
case "default-config": return [getDefaultConfiguration(settings.platform)];
case "configs": return configurations;
case "default-build": return [builtinBuildTypes[0]];
Expand All @@ -1220,15 +1220,18 @@ class Project {
/// Returns the relative or absolute path to the output file for the given
/// generator settings including target name and platform specific file
/// extension.
final NativePath determineOutputPath(const ref GeneratorSettings settings)
final NativePath[] determineOutputPaths(const ref GeneratorSettings settings)
{
return determineOutputPath(settings.platform, settings.buildSettings, settings.compiler);
return determineOutputPaths(settings.platform, settings.buildSettings, settings.compiler);
}

/// ditto
NativePath determineOutputPath(const ref BuildPlatform platform, const ref BuildSettings buildSettings, const Compiler compiler)
NativePath[] determineOutputPaths(const ref BuildPlatform platform, const ref BuildSettings buildSettings, const Compiler compiler)
{
return NativePath(buildSettings.targetPath) ~ compiler.getTargetFileName(buildSettings, platform);
auto root = NativePath(buildSettings.targetPath);
if (!root.absolute)
root = m_rootPackage.path ~ root;
return [root ~ compiler.getTargetFileName(buildSettings, platform)];
}

/// Outputs requested data for the project, optionally including its dependencies.
Expand Down

0 comments on commit 7ee241d

Please sign in to comment.