You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One idea I had would be to separate tools from the toolchain, giving essentially full control over the entire pipeline
tool("mycxx")
set_bindir("path/to/bin") -- "mycxx.exe" is assumedset_kind("file") -- run this per fileset_filetypes("cpp") -- run this only on .cpp filesset_extension("o") -- generate .o file for linker/archiverset_format("gcc") -- use default gcc format --> mycxx -c -o file.o main.cpp -Wall-- alternatively, for custom formatsset_format({ "-key $(key)", "-c -o $(outfile)", "$(flags)", "$(file)" })
--> mycxx -key P -c -o main.o -Wall main.cpptool_end()
key thing to note here would be the set_kind, which would specify if the tool is run once per file, like compilers, or once per output, like the linker
it would determine what is input into the $(file) or $(files) keys.
creating the toolchain would then be more like
toolchain("MyToolchain") -- tools are run in order they are addedadd_tool("mycxx")
add_tool("myar", { kind="static" }) -- not sure how kinds should be handeledadd_tool("myld", { kind="binary" })
toolchain_end()
target("project")
set_kind("binary")
add_files("src/main.cpp")
set_toolchain("MyToolchain")
set_toolvar("key", "P") -- user variableset_flag("-Wall")
target_end()
In some aspects it's similar to the rule API.
This would at least satisfy the needs for some Sony platforms I've worked with.
This tool api could then be extended to other areas, like custom debuggers or specific platform tools
Is your feature request related to a problem? Please describe.
But I haven't figured out how to design the API yet.
Describe the solution you'd like
.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: