Skip to content

Add toolsetpath API for specifying tool executable paths #2462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tritao
Copy link
Contributor

@tritao tritao commented Apr 19, 2025

Introduces a new API function toolsetpath(toolsetName, toolName, toolPath) that allows users to specify custom paths for tool executables within their Premake scripts.

This provides a mechanism to override the default tool lookup behavior for specific toolsets and tools, offering greater flexibility in build configurations.

Changes include:

  • Registering the toolsetpaths field in _premake_init.lua to store the custom paths.
  • Implementing the toolsetpath function in base/api.lua to process and store the provided paths.
  • Modifying the gettoolname functions in the GCC, Clang, MSVC, SNC, .NET, and Emscripten toolset modules to check for and use paths defined via toolsetpaths before falling back to default lookup logic.
  • Adding tests in the corresponding toolset test files (tests/tools/) to verify that the toolsetpath setting correctly overrides the default behavior.
  • Creating a new documentation page (website/docs/toolsetpath.md) detailing the API function, its parameters, and usage.
  • Adding an entry for the new documentation page in the website sidebar (website/sidebars.js).

@tritao tritao force-pushed the add-toolsetpath-api branch from 8fd8b95 to c0187fd Compare April 19, 2025 20:13
Introduces a new API function `toolsetpath(toolsetName, toolName,
toolPath)` that allows users to specify custom paths for tool
executables within their Premake scripts.

This provides a mechanism to override the default tool lookup behavior
for specific toolsets and tools, offering greater flexibility in build
configurations.

Changes include:
- Registering the `toolsetpaths` field in `_premake_init.lua` to store
the custom paths.
- Implementing the `toolsetpath` function in `base/api.lua` to process
and store the provided paths.
- Modifying the `gettoolname` functions in the GCC, Clang, MSVC, SNC,
.NET, and Emscripten toolset modules to check for and use paths defined
via `toolsetpaths` before falling back to default lookup logic.
- Adding tests in the corresponding toolset test files (`tests/tools/`)
to verify that the `toolsetpath` setting correctly overrides the default
behavior.
- Creating a new documentation page (`website/docs/toolsetpath.md`)
detailing the API function, its parameters, and usage.
- Adding an entry for the new documentation page in the website sidebar
(`website/sidebars.js`).
@tritao tritao force-pushed the add-toolsetpath-api branch from c0187fd to 315ca63 Compare April 19, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant