- Windows 10 Version 1809
- Eclipse IDE for C/C++ Developers (Version: 2019-06 (4.12.0))
- cmake4eclipse 2.1.1
- cmake version 3.17.0
- GNU Make 4.2.1
repository for a simple example project: https://bitbucket.org/ChristianW/cmake_driven_example_arm-none-eabi-gcc/src/master/
When using the arm-none-eabi-gcc compiler, the Eclipse C/C++ Editor does not recognize my symbols set in the CMakeLists.txt.
...
if(1)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
else()
set(CMAKE_C_COMPILER gcc)
endif()
...
When using the gcc compiler, the Eclipse C/C++ Editor does recognize my symbols set in the CMakeLists.txt.
...
if(0)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
else()
set(CMAKE_C_COMPILER gcc)
endif()
...
In both cases building the project is working. Any ideas what's the problem here?
Kind regards, Christian
Edit: content of CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
#set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/mingw32-make.exe")
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/mingw32-make.exe")
#set(CMAKE_MAKE_PROGRAM "C:/Tools/ON Semiconductor/RSL10_IDE_3_3/IDE_V3.2.2.13/arm_tools/bin/make.exe")
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING 1)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
set(CMAKE_C_OBJCOPY arm-none-eabi-objcopy)
if(1)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
else()
set(CMAKE_C_COMPILER gcc)
endif()
project(cmake_driven_example_arm-none-eabi-gcc C)
set(SOURCES
main.c
modules/math/math.c
)
include_directories(
modules/math
)
set(CMAKE_C_FLAGS "-DINCLUDE_MATH")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMYVAR=5")
# Invoking: Cross ARM C Linker
set(CMAKE_EXE_LINKER_FLAGS "-Xlinker --gc-sections")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T\"${CMAKE_SOURCE_DIR}/sdk_packages/rsl10_sdk/source/firmware/cmsis/source/GCC/sections_modified.ld\"")
# build elf file
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/sdk_packages/rsl10_sdk/lib/ble_core/Release/libblelib.a
${CMAKE_SOURCE_DIR}/sdk_packages/rsl10_sdk/lib/ble_core/Release/libkelib.a
)