-
Notifications
You must be signed in to change notification settings - Fork 170
Added option to pass custom C postprocessor #1331
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
base: main
Are you sure you want to change the base?
Conversation
integration_tests/CMakeLists.txt
Outdated
add_custom_command( | ||
OUTPUT ${name}.c | ||
COMMAND lpython --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py | ||
--custom-c-postprocessor ${CMAKE_CURRENT_SOURCE_DIR}/${custom_c_postprocessor} > ${name}.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think as part of this change, let's not do --show-c
, but rather save the result to a file ourselves, so no need for ">" which is quite fragile in build systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Will do this on Thursday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please check the latest diff and let me know if you have any questions.
Thanks for this, the other thing we need is to allow passing arguments to the script. I have just refactored such a script so that it accepts an argument of a |
Well what do you think about this - Instead of passing a bunch of arguments to the post processor via LPython, can we just create a |
76883ff
to
bd88467
Compare
bd88467
to
004a1af
Compare
Yes, the JSON approach is fine. |
I will test this PR manually and see if it satisfies our use case. |
cc: @certik