This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to configure toolchains to generate build files for unit tests?

Hi There,

I am trying to generate build files for unit tests according to nRF5 SDK for Mesh v5.0.0. It could succeed. I try everything, it still cannot work. (In windows 10)

1. Enter "cmake -G Ninja -DBUILD_HOST=ON -DCMAKE_BUILD_TYPE=Debug .."

 CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler

"C:/MinGW/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/BLE/Mesh/sdk/blecom/nrf5_SDK_for_Mesh_v5.0.0_src/build_host/CMakeFiles/CMakeTmp

Run Build Command(s):C:/ProgramData/chocolatey/bin/ninja.exe cmTC_e3c7c && [1/2] Building C object CMakeFiles\cmTC_e3c7c.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_e3c7c.dir/testCCompiler.c.obj
C:\MinGW\bin\gcc.exe --std=gnu99 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -m32 -Wall -Wextra -Werror=implicit-function-declaration -Wno-format -Wno-unused-parameter -Wno-missing-field-initializers -Wno-expansion-to-defined -mno-ms-bitfields -o CMakeFiles\cmTC_e3c7c.dir\testCCompiler.c.obj -c C:\BLE\Mesh\sdk\blecom\nrf5_SDK_for_Mesh_v5.0.0_src\build_host\CMakeFiles\CMakeTmp\testCCompiler.c
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:75 (enable_language);

************************************************************************************************************

2. Enter "cmake -G Ninja -DCMOKE_ROOT=C: ..\..\CMock\ -DBUILD_HOST=ON -DCMAKE_BUILD_TYPE=Debug .."

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler

"C:/MinGW/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/BLE/Mesh/sdk/blecom/nrf5_SDK_for_Mesh_v5.0.0_src/build_host/CMakeFiles/CMakeTmp

Run Build Command(s):C:/ProgramData/chocolatey/bin/ninja.exe cmTC_0baa4 && [1/2] Building C object CMakeFiles\cmTC_0baa4.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_0baa4.dir/testCCompiler.c.obj
C:\MinGW\bin\gcc.exe --std=gnu99 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -m32 -Wall -Wextra -Werror=implicit-function-declaration -Wno-format -Wno-unused-parameter -Wno-missing-field-initializers -Wno-expansion-to-defined -mno-ms-bitfields -o CMakeFiles\cmTC_0baa4.dir\testCCompiler.c.obj -c C:\BLE\Mesh\sdk\blecom\nrf5_SDK_for_Mesh_v5.0.0_src\build_host\CMakeFiles\CMakeTmp\testCCompiler.c
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:75 (enable_language)

Parents Reply Children
No Data
Related