-
-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve custom toolchain to support unknown compiler/linker. #5554
Comments
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 assumed
set_kind("file") -- run this per file
set_filetypes("cpp") -- run this only on .cpp files
set_extension("o") -- generate .o file for linker/archiver
set_format("gcc") -- use default gcc format
--> mycxx -c -o file.o main.cpp -Wall
-- alternatively, for custom formats
set_format({ "-key $(key)", "-c -o $(outfile)", "$(flags)", "$(file)" })
--> mycxx -key P -c -o main.o -Wall main.cpp
tool_end() key thing to note here would be the creating the toolchain would then be more like toolchain("MyToolchain") -- tools are run in order they are added
add_tool("mycxx")
add_tool("myar", { kind = "static" }) -- not sure how kinds should be handeled
add_tool("myld", { kind = "binary" })
toolchain_end()
target("project")
set_kind("binary")
add_files("src/main.cpp")
set_toolchain("MyToolchain")
set_toolvar("key", "P") -- user variable
set_flag("-Wall")
target_end() In some aspects it's similar to the This tool api could then be extended to other areas, like custom debuggers or specific platform tools debugger("MyDebugger")
set_filetypes("elf")
add_tool("mydbg")
debugger_end()
target("project")
set_kind("binary")
add_files("src/main.cpp")
set_toolchain("MyToolchain")
set_toolchain("MyDebugger")
set_toolvar("key", "P") -- user variable
set_flag("-Wall")
target_end() |
Now we can add whole custom unknown toolchain. But no docs now. https://github.com/xmake-io/xmake/tree/dev/tests/apis/custom_toolchain |
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: