# Cross compilation with Renesas ccrx compiler

**URL:** https://discourse.cmake.org/t/cross-compilation-with-renesas-ccrx-compiler/15326
**Category:** Usage
**Created:** [November 19, 2025, 2:22pm UTC](https://discourse.cmake.org/t/cross-compilation-with-renesas-ccrx-compiler/15326 "2025-11-19T14:22:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gildas\_Allain](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gildas_allain/32/5913_2.png) [@gildas\_Allain](https://discourse.cmake.org/u/gildas_Allain)
#### Post date: [November 19, 2025, 2:22pm UTC](https://discourse.cmake.org/t/cross-compilation-with-renesas-ccrx-compiler/15326/1 "2025-11-19T14:22:54Z")

</div>

Hi,

I was pleased to learn about the support for the Renesas CCRX compiler since version 4.1 but I am still encountering difficulties setting it up.

My crosstoolchain file defines the compiler path and other stuff

```cmake
...
SET(CMAKE_C_COMPILER "${CCRX_ROOT}/bin/ccrx.exe")
...

```

The configure step failed with the following error. The CCRX compiler does not seem to be detected. Why ? Should I need specific definition to hepl CMake to detect the compiler ?

```cmake
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is unknown
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: C:/Tools/Renesas/RX/2_8_0/bin/ccrx.exe
[cmake] -- Check for working C compiler: C:/Tools/Renesas/RX/2_8_0/bin/ccrx.exe - broken
[cmake] -- Configuring incomplete, errors occurred!
[cmake] CMake Error at C:/Tools/CMake/share/cmake-4.1/Modules/CMakeTestCCompiler.cmake:67 (message):
[cmake] The C compiler
[cmake] 
[cmake] "C:/Tools/Renesas/RX/2_8_0/bin/ccrx.exe"
[cmake] 
[cmake] is not able to compile a simple test program.
[cmake] 
[cmake] It fails with the following output:
[cmake] 
[cmake] Change Dir: 'C:/Users/gallain/Documents/Sources/CMake-ccrx/build/CMakeFiles/CMakeScratch/TryCompile-r2cmwt'
[cmake]

```

I tried forcing the compiler with :

```cmake
...
SET(CMAKE_C_COMPILER "${CCRX_ROOT}/bin/ccrx.exe")
SET(CMAKE_C_COMPILER_ID CCRX)
SET(CMAKE_C_COMPILER_ID_RUN TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
...

```

But this implies adding in my crosstoolchain :

```cmake
SET(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} -output=obj=<OBJECT> <SOURCE>")

```

And in the CMakeLists.txt

```cmake
set(CMAKE_INCLUDE_FLAG_C "-include=")

```

Could you tell me where I’m going wrong?

Any assistance is appreciated.

Regards,

Gildas

---

<div class="post-metadata">

### Author: ![jrast](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jrast/32/5954_2.png) [@jrast](https://discourse.cmake.org/u/jrast)
#### Post date: [December 17, 2025, 4:04pm UTC](https://discourse.cmake.org/t/cross-compilation-with-renesas-ccrx-compiler/15326/2 "2025-12-17T16:04:15Z")

</div>

Which CC-RX Version are you using? For me it failed with CC-RX Version 3.1.0 but the compiler identification for version 3.7.0 did work.

Edit… Just saw it: According to your compiler location you are probably using a compiler version \< 3, which seems to fail the compiler identification

For reference, this is my toolchain file:

```auto
# Toolchain file for Renesas RX Compiler
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR rx)

# Specify the cross compiler
# Note: CC-RX Version 3.1.0 does not work!!
set(TOOLCHAIN_PREFIX "C:/Program Files (x86)/Renesas/RX/3_7_0/bin")
set(CMAKE_C_COMPILER "${TOOLCHAIN_PREFIX}/ccrx.exe")
set(CMAKE_ASM_COMPILER "${TOOLCHAIN_PREFIX}/ccrx.exe") 

# Common compiler options 
# -isa must be set, otherwise compiler identification fails
# -nologo suppresses the logo banner on each invocation
set(CCRX_COMMON_OPTIONS "-isa=rxv2 -nologo")
set(CMAKE_C_FLAGS "${CCRX_COMMON_OPTIONS}")
set(CMAKE_ASM_FLAGS "${CCRX_COMMON_OPTIONS}")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

```

---

<div class="post-metadata">

### Author: ![gildas\_Allain](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gildas_allain/32/5913_2.png) [@gildas\_Allain](https://discourse.cmake.org/u/gildas_Allain)
#### Post date: [December 19, 2025, 10:59am UTC](https://discourse.cmake.org/t/cross-compilation-with-renesas-ccrx-compiler/15326/3 "2025-12-19T10:59:46Z")

</div>

@jrast, I’m using CCRX v2.08 and now all is working fine.

The following configuration was mandatory to get the compiler detected by CMake. Try to add BIN\_RX/INC\_RX and TMP\_RX to your Windows env.

1. Add variable BIN\_RX = C:\Tools\Renesas\RX\2\_8\_0\bin
2. Add variable INC\_RX = C:\Tools\Renesas\RX\2\_8\_0\include
3. Add varaible TMP\_RX = C:\Tools\Renesas\RX\2\_8\_0\
4. Add to path : C:\Tools\Renesas\RX\2\_8\_0\bin

My toolchain file is now :

```auto
SET(CMAKE_SYSTEM_NAME Generic)
SET(CCRX_ROOT "C:/Tools/Renesas/RX/2_8_0")
SET(CMAKE_C_COMPILER "${CCRX_ROOT}/bin/ccrx.exe")
SET(CMAKE_C_FLAGS "-isa=rxv1 -nologo")

```

Regards
