Merge topic 'renesas_compiler_toolchain_doc'

6139bb7903 Help: Document Renesas compiler toolchain

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11446
This commit is contained in:
Brad King
2025-11-26 15:47:17 +00:00
committed by Kitware Robot

View File

@@ -723,3 +723,56 @@ For example, a toolchain file might contain:
set(CMAKE_CXX_COMPILER /path/to/em++)
.. _`Emscripten`: https://emscripten.org/
Cross Compiling using Renesas compilers
---------------------------------------
For cross-compiling with Renesas compilers, specify at least:
:variable:`CMAKE_SYSTEM_NAME`
Set to ``Generic``. Must be specified to enable cross compiling.
:variable:`CMAKE_C_COMPILER <CMAKE_<LANG>_COMPILER>`
Set to the path to the Renesas C compiler, e.g.,
``ccrx``, ``ccrl``, or ``ccrh``.
:variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`
Set to the ``-isa=`` or ``-cpu=`` flag the compiler requires.
See example toolchain files in the following sections.
Renesas CC-RX
^^^^^^^^^^^^^
.. code-block:: cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER "ccrx.exe")
set(CMAKE_ASM_COMPILER "ccrx.exe") # if using ASM language
set(CMAKE_C_FLAGS "-isa=rxv3") # specify the version of target RX CPU
set(CMAKE_EXE_LINKER_FLAGS "-lnkopt=<your linker option here>")
Renesas CC-RL
^^^^^^^^^^^^^
.. code-block:: cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER "ccrl.exe")
set(CMAKE_ASM_COMPILER "ccrl.exe") # if using ASM language
set(CMAKE_C_FLAGS "-cpu=S3") # specify the version of target RL CPU
# To avoid test executable runs out of const section's size.
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
# Specifying device file and section layout linker options through compiler driver.
set(CMAKE_EXE_LINKER_FLAGS "-lnkopt=-device=dr5f10y14.dvf -lnkopt=-auto_section_layout")
Renesas CC-RH
^^^^^^^^^^^^^
.. code-block:: cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER "ccrh.exe")
set(CMAKE_ASM_COMPILER "ccrh.exe") # if using ASM language
set(CMAKE_C_FLAGS "-Xcommon=rh850") # specify the version of target RH850 CPU
set(CMAKE_EXE_LINKER_FLAGS "-lnkopt=<your linker option here>")