diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index cbd1f74b69..bb32490e38 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -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 _COMPILER>` + Set to the path to the Renesas C compiler, e.g., + ``ccrx``, ``ccrl``, or ``ccrh``. + +:variable:`CMAKE_C_FLAGS _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=") + +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=")