diff --git a/tools/legacy/build_plugin_2601_vs2026.py b/tools/legacy/build_plugin_2601_vs2026.py index 233953d..1becb6d 100755 --- a/tools/legacy/build_plugin_2601_vs2026.py +++ b/tools/legacy/build_plugin_2601_vs2026.py @@ -630,6 +630,9 @@ Examples: help='Disable additional build optimizations') parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto', help='Visual Studio version to use (default: auto)') + parser.add_argument('--dist', action='store_true', + help='Copy built DLLs to /dist/ instead ' + 'of /plugins/') args = parser.parse_args() @@ -642,6 +645,9 @@ Examples: # Get project paths project_dir, project_file, plugins_dir = get_project_paths(platform_toolset) + # --dist: redirect the output root from /plugins to /dist. + if args.dist: + plugins_dir = plugins_dir.parent / 'dist' if args.list_project: if not project_file.exists(): diff --git a/tools/linux/build_plugin_linux.py b/tools/linux/build_plugin_linux.py index 6079e41..93edfe1 100644 --- a/tools/linux/build_plugin_linux.py +++ b/tools/linux/build_plugin_linux.py @@ -151,6 +151,7 @@ def _build_one( jobs: int, clean: bool, cleanup_artifacts: bool, + dist: bool = False, ) -> int: layout = VERSION_LAYOUT[zip_version] vendor_7zip = layout["vendor_7zip"] @@ -243,7 +244,10 @@ def _build_one( print(f"ERROR: expected artifact not found: {built}", file=sys.stderr) return 1 - dest = ROOT / cfg["dest"] + rel_dest = cfg["dest"] + if dist and rel_dest.startswith("plugins/"): + rel_dest = "dist/" + rel_dest[len("plugins/"):] + dest = ROOT / rel_dest dest.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(built, dest) @@ -303,6 +307,12 @@ def main() -> int: help="Keep per-config build artifact directories (_o_*)", ) parser.add_argument("--verbose", action="store_true", help="Verbose output") + parser.add_argument( + "--dist", + action="store_true", + help="Copy built DLLs to /dist/ instead of " + "/plugins/", + ) args = parser.parse_args() _require_tool("make") @@ -327,6 +337,7 @@ def main() -> int: jobs, args.clean, args.cleanup_artifacts, + args.dist, ) if code != 0: return code