Closed LanceBeasley closed 1 week ago
This is a good idea. :)
Is there a work-around in the mean time, even if its ugly?
Do you use the same assembly files in all your tests or are you attempting to test an assembly file?
If the former, maybe instead of adding the assembly as standard source files in Ceedling, you use the :command_hooks
plugin to compile them separately using :pre_link_execute
or something like that? Then you could just manually add the extra file(s) to the linker arguments.
If the latter, I'm not sure where to go with that. I suspect if we used the :post_compile_execute
hook, we could rename the file to match the others, but I don't know that it would ilnk properly with the wrong extension.
I just tried renaming the s_source.o to s_source.p1. The compiler didn't like it ;(
I really need the link step to use: c_source.p1 s_source.o
Or, I can manually edit run the link step after it fails. Then, how do I run the test but skip the build?
If the yml file can contain conditionals for each test, maybe there's a way to remove the s-source.p1 file from the link step and manually add the s-source.o?
I've hacked a work-around. Just before the assembly shell command is built, search and replace the extension of the assembly object files. The extensions are hard-coded, and so won't pick up the settings in the project.yml file. But- it works!
1) Add the following lines to generator.rb:
arg_hash[:objects].map! { |n| (n.include? "_asm") ? (n.gsub(/.p1/, ".o")) : n } @streaminator.stdout_puts(arg_hash[:objects], Verbosity::NORMAL)
2) Append _asm to all the assembly source file names. Also append _asm to the associated .h files. In other words:
source.s -> source_asm.s source.h -> source_asm.s
If you don't, Ceedling won't find the assembly file, prompting "undefined" errors for the assembly routines.
Closing this issue but only to cull the open issue list a bit. I'm also rolling this issue up into a single issue that deals with multiple file extensions for a single file type.
The Microchip XC8 compiler generates .p1 files for C-source, and .o files for assembly-source.
The :extension:object entry in the project.yml file assigns the same extension to all object/intermediate files.
I'm requesting you add a new config option- :extension:assembly-object. This would allow Ceedling to use a different extension for C and Assembly object files.