This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh SDK: CMake providing wrong compiler options

I am trying to build examples from mesh SDK(light example). I have installed toolchain, CMake and Ninja but CMake fails. Below is the output of CMake.

$ cmake -G Ninja -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52832_xxAA ..
-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: C:/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "C:/Program Files (x86)/GNU Tools ARM Embedded/7 2017-q4-major/bin/arm-none-eabi-gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: E:/Prasad/Charlie_repo/SDK/nrf5_SDK_for_Mesh_v1.0.1_src/examples/light_switch/build/CMakeFiles/CMakeTmp

    Run Build Command:"C:/ninja-win/ninja.exe" "cmTC_a50df"
    [1/2] Building C object CMakeFiles/cmTC_a50df.dir/testCCompiler.c.obj
    [2/2] Linking C executable cmTC_a50df.exe
    FAILED: cmTC_a50df.exe
    cmd.exe /C "cd . && C:\PROGRA~2\GNUTOO~1\72017-~1\bin\AR19DD~1.EXE    CMakeFiles/cmTC_a50df.dir/testCCompiler.c.obj  -o cmTC_a50df.exe -Wl,--out-implib,libcmTC_a50df.dll.a -Wl,--major-image-version,0,--minor-image-version,0   && cd ."
    c:/progra~2/gnutoo~1/72017-~1/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version'
    c:/progra~2/gnutoo~1/72017-~1/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.




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


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.10)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "E:/Prasad/Charlie_repo/SDK/nrf5_SDK_for_Mesh_v1.0.1_src/examples/light_switch/build/CMakeFiles/CMakeOutput.log".
See also "E:/Prasad/Charlie_repo/SDK/nrf5_SDK_for_Mesh_v1.0.1_src/examples/light_switch/build/CMakeFiles/CMakeError.log".

Related