Replace default compiler option (-o, -c, etc..) with CCRX-supported options (-output,...)


I am working on a Renesas CCRX-based CMakeLists.txt for AmazonFreeRTOS project. However, I ran into the following error when I did a ‘make all’:

E0511108:The “-o” option is not recognized.
E0511134:Input file “CMakeFiles/afr_kernel.dir/freertos_kernel/event_groups.c.obj” is not found.
E0511108:The “-c” option is not recognized.
CMakeFiles/afr_kernel.dir/build.make:81: recipe for target ‘CMakeFiles/afr_kernel.dir/freertos_kernel/event_groups.c.obj’ failed
make[2]: *** [CMakeFiles/afr_kernel.dir/freertos_kernel/event_groups.c.obj] Error 1
CMakeFiles/Makefile2:966: recipe for target ‘CMakeFiles/afr_kernel.dir/all’ failed
make[1]: *** [CMakeFiles/afr_kernel.dir/all] Error 2
Makefile:102: recipe for target ‘all’ failed
make: *** [all] Error 2

As indicated in the error message, -o and -c options are not recognized because they are not CCRX options (GNU option maybe?)

These options are not included in my CMakeLists compile option:

# This is a snippet from vendors\renesas\boards\rx_mcu_boards\rx65n-rsk\CMakeLists.txt

set(compiler_flags -isa=rxv2 -fpu -utf8 -branch=32 -nomessage=11174,21644,20010,23034,23035,20177,23033
-output=obj -debug -nologo)
# Compiler flags.

so they must have been added by some AmazonFreeRTOS .cmake file in background.

My question is: How do I replace -o, -c options with CCRX-supported options (e.g: -output)?
I manage to change C_INCLUDE flag from “-I” to “-include”, but there doesn’t seem to be any information on changing other default flags.

Any assistance is appreciated.
Thank you.

Looking at the comment here, it seems that CCRX is not supported in CMake:

It is probably a better question to ask Renesas.


I checked with Renesas and they confirmed that CCRX is not supported in CMake…


I think you can manipulate CMAKE_C_FLAGS (there are.a few more related CMake variables).
Maybe simply string (REPLACE...) the generated GCC options with the desired ones is sufficient.