Skip to content
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

Prepending toolchain flags or setting tool parameter order #5571

Open
ArgoreOfficial opened this issue Sep 4, 2024 · 3 comments
Open

Prepending toolchain flags or setting tool parameter order #5571

ArgoreOfficial opened this issue Sep 4, 2024 · 3 comments

Comments

@ArgoreOfficial
Copy link

ArgoreOfficial commented Sep 4, 2024

Is your feature request related to a problem? Please describe.

A specialized archiver I am working with uses the format ar [mode] -o [outFile] [inputFiles...]
This mode flag has to be the first parameter, and from what I have found you are only able to append flags at the end

Describe the solution you'd like

add_arflags("mode", { prepend = true })
this would yield the following command
artool mode -o "outfile.a" "one.o" "two.o" "three.o" ...etc

Describe alternatives you've considered

alternatively some way to directly set the order
set_ar_order({ "userflags", "defaultflags", "files", ...etc })

Additional context

No response

@ArgoreOfficial
Copy link
Author

for now I've solved this with an intermediate executable that takes the xmake inputs and reformats them for the archiver

having it natively in xmake would be nice though

@waruqi
Copy link
Member

waruqi commented Sep 6, 2024

Reordering flags is not supported yet, and it's complicated to implement.

if you use specialized archiver, you can call set_toolset("ar@artool mode") to set mode.

or write a shell script to wrap it to ar

or wait for this feature to custom toolchain command and flags. #5554

@ArgoreOfficial
Copy link
Author

I tried doing "ar@artool mode" but that failed due to the exec trying to run a file named artool mode.
if I remember correctly the command it called looked something like
exec( "\"artool mode\" -o file... ..etc" )

I'll wait for the feature, my workaround does its job for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants