This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Creating CCS 6 Projects with CMake

Other Parts Discussed in Thread: TI-CGT

Hello,

currently I want to create a project for CCS6 in CMake to be able for not having to change the paths for the project on every system. Therefore. I created a toolchainfile for the compiler and Created Unix Makefiles for Eclipse in CMake. I tried it with ti-cgt compiler and ti gcc-4.8. I attachted the toolchain files. With the ti-cgt compiler, I get the error, that no input sections were deined, with the gcc I get that "_exit" symbol would not be defined when CMake cehcks the compiler abilities. Did anyone ever try to use CCS with CMake?

#include(CMakeForceCompiler)
# this one is important
set(CMAKE_SYSTEM_NAME "Generic")

set(TOOLCHAIN_COMPILER_IDENTIFIER "gcc-arm-none-eabi" CACHE STRING "compiler identifier" FORCE)

set(CMAKE_MAKE_PROGRAM "C:/TI/ccsv6/utils/bin/gmake.exe"                CACHE STRING "make program")



set(HERCULES_PATH "${CMAKE_CURRENT_LIST_DIR}/gcc-arm-none-eabi-4_8-2014q3/")

# specify the cross compiler
SET(CMAKE_C_COMPILER   ${HERCULES_PATH}/bin/arm-none-eabi-gcc.exe)
SET(CMAKE_CXX_COMPILER ${HERCULES_PATH}/bin/arm-none-eabi-g++.exe)
SET(CMAKE_ASM_COMPILER ${HERCULES_PATH}/bin/arm-none-eabi-as.exe)
#ENABLE_LANGUAGE(ASM)
#set(CMAKE_AR           "${HERCULES_PATH}/bin/armar") 

# skip compiler tests
set(CMAKE_ASM_COMPILER_WORKS 1) 
set(CMAKE_C_COMPILER_WORKS   1) 
set(CMAKE_CXX_COMPILER_WORKS 1) 
#set(CMAKE_DETERMINE_ASM_ABI_COMPILED 1) 
#set(CMAKE_DETERMINE_C_ABI_COMPILED   1) 
#set(CMAKE_DETERMINE_CXX_ABI_COMPILED 1) 


# Add the default include and lib directories for tool chain
include_directories(${HERCULES_PATH}/arm-none-eabi/include)
include_directories("C:/TI/tirtos_tivac_2_14_00_10/packages/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/packages/ti/drivers/wifi/cc3100/Simplelink/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/packages/ti/drivers/wifi/cc3100/Simplelink/Include/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/products/bios_6_42_01_20/packages/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/products/ndk_2_24_03_35/packages/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/products/TivaWare_C_Series-2.1.1.71b/")
include_directories("C:/TI/tirtos_tivac_2_14_00_10/products/uia_2_00_02_39/packages")
include_directories("C:/TI/xdctools_3_31_01_33_core/packages/")
#include_directories("C:/TI/TivaWare_C_Series-2.1.0.12573/")

link_directories(${HERCULES_PATH}lib)

message("link_directories(${HERCULES_PATH}lib)")

# set target environment
set(CMAKE_FIND_ROOT_PATH ${HERCULES_PATH})

# specifiy target cpu flags

set(PLATFORM_CONFIG_C_FLAGS    "--specs=nosys.specs" CACHE STRING "platform config c flags")
#set(PLATFORM_CONFIG_C_FLAGS    "-mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O2 -g" CACHE STRING "platform config c flags")
set(PLATFORM_CONFIG_CXX_FLAGS  "${PLATFORM_CONFIG_C_FLAGS}"                                  CACHE STRING "platform config cxx flags")

# combine flags to C and C++ flags
SET(CMAKE_C_FLAGS "${PLATFORM_CONFIG_C_FLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${PLATFORM_CONFIG_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")



#include(CMakeForceCompiler)
# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_MAKE_PROGRAM "C:/TI/ccsv6/utils/bin/gmake.exe"                CACHE STRING "make program")

set(HERCULES_PATH "${CMAKE_CURRENT_LIST_DIR}/ti-cgt-arm_5.2.5/")

# specify the cross compiler
SET(CMAKE_C_COMPILER   ${HERCULES_PATH}/bin/armcl.exe)
SET(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER})
#SET(CMAKE_ASM_COMPILER ${HERCULES_PATH}/bin/armasm.exe)
#ENABLE_LANGUAGE(ASM)
#set(CMAKE_AR           "${HERCULES_PATH}/bin/armar") 

# skip compiler tests
#set(CMAKE_ASM_COMPILER_WORKS 1) 
#set(CMAKE_C_COMPILER_WORKS   1) 
#set(CMAKE_CXX_COMPILER_WORKS 1) 
#set(CMAKE_DETERMINE_ASM_ABI_COMPILED 1) 
#set(CMAKE_DETERMINE_C_ABI_COMPILED   1) 
#set(CMAKE_DETERMINE_CXX_ABI_COMPILED 1) 


# Add the default include and lib directories for tool chain
include_directories(${HERCULES_PATH}/include)

link_directories(${HERCULES_PATH}lib)

message("link_directories(${HERCULES_PATH}lib)")

# set target environment
set(CMAKE_FIND_ROOT_PATH ${HERCULES_PATH})

# specifiy target cpu flags
set(PLATFORM_CONFIG_C_FLAGS    "-mv7M4 --code_state=16 --float_support=vfplib --abi=eabi -me --include_path=C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include -g --define=cc3200 --display_error_number --diag_warning=225 --diag_wrap=off" CACHE STRING "platform config c flags")
set(PLATFORM_CONFIG_CXX_FLAGS  "${PLATFORM_CONFIG_C_FLAGS}"                                  CACHE STRING "platform config cxx flags")

# combine flags to C and C++ flags
SET(CMAKE_C_FLAGS "${PLATFORM_CONFIG_C_FLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${PLATFORM_CONFIG_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")

SET(CMAKE_EXE_LINKER_FLAGS "-mv7M4 --code_state=16 --float_support=vfplib --abi=eabi -me -g --define=cc3200 --display_error_number --diag_warning=225 --diag_wrap=off -z -mwifi2cloud.map --heap_size=0x0 --stack_size=0x512 -iC:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/lib -iC:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info=wifi2cloud_linkInfo.xml --rom_model")


Best regards,
Michael

  • Michael Dick87 said:
    With the ti-cgt compiler, I get the error, that no input sections were deined,

    Can you post the full output of the CCS build? 

    Michael Dick87 said:
    with the gcc I get that "_exit" symbol would not be defined

    You may need to add the "nosys" library, or pass the --specs=nosys.specs option to the GCC linker. Depending on the code, usually a minimum set of GCC libraries are needed to get an error-free link. I have found -lc -lgcc -lnosys to work in most cases, but your app may require others. I have found answers to many GCC related questions just by doing a web search, so that could be another resource for investigating your GCC build errors.