您好!
我正在尝试为 MMWAVE_automotive_toolbox_3_5_0附带的 MSS 演示代码设置构建系统。
我能够创建一个从 CCS 获取参考的工具链。 我现在正在尝试编译一个简单的 helloworld 程序以测试我的工具链。
在运行 gmake 时、出现以下错误。
[50%]←[32m 构建 C 对象 CMakeFiles/helloworld.xer4f.dir/helloworld.c.obj←[0m
D:\DMS\Radar\ti-cgt-arm_16.9.6.LTS \bin\armcl.exe --compile_only --c_file=D:\DMs\Radar\CmakeHelloworldProject\helloworld.c --include_path=D:\DMS\Radar\ti-cgt_arm_16.9.6LTS \eldle=-exclus_exclus_exclus=-volature=vrf-nature=-r4g=vateg_example.g=-memb_subsection=-voltid_ex-voltage-voltage=vature=vr4g_ex-voltage-rg=vature=vateg_ex-voltage-rg=vature=vature=vrg=vateg_ex-voltag_ex-f_ex-r.ature=-f_ex-mag_ex-voltage-mag-r.
错误#24002-D:option --output_file 与之前的选项--obj_extension 冲突
我需要使用 --obj_extension=.oer4f 、因为这是在 CCS 中指定为目标文件扩展名的内容。
CCS 指令和 cmake 生成的指令之间的唯一区别是--output_file=cmakeFiles\helloworld.xer4f.dir\helloworld.c.obj
因此、我需要在两个问题上提供帮助。
1.如何在 cmake 中将目标文件扩展名更改为.oer4f?
2从何处获得 --output_file=cmakeFiles\helloworld.xer4f.dir\helloworld.c.obj 选项(由 cmake 生成)? 如何将其删除?
******** 工具链图标
#根据您的需求设置此路径
if (未定义 CGT_toolchain_DIR)
设置(CGT_toolchain_DIR "D:/DMS/Radar/ti-cgt-arm_16.9.6.LTS)
消息(状态"CGT_toolchain_DIR 未显式设置、使用"${CGT_toolchain_DIR})
endif()
#设置目标系统
设置(CMAKE_SYSTEM_NAME 通用)
设置(CMAKE_C_Compiler_ID "TI")
设置(CMAKE_Try 编译目标类型静态库)
#工具链路径
find_program (TI_GCC 名称 armcl 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_CXX 命名 armcl 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_AS 名称 armcl 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_AR 名称 armar 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_objcopy 名称 armofd 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_OBJDUMP 名称 armhex 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_size 名称 armsize 路径${CGT_toolchain_DIR}/bin no_default_path)
find_program (TI_LD 命名 armcl 路径${CGT_toolchain_DIR}/bin no_default_path)
#设置可执行文件设置
SET (CMAKE_C_COMPILER ${TI_GCC})
设置(CMAKE_CXX_COMPILER ${TI_CXX})
设置(作为${TI_AS})
设置(AR ${TI_AR})
设置(objcopy ${TI_objcopy})
设置(OBJDUMP ${TI_OBJDUMP})
设置(大小${TI_SIZE})
设置(LD ${TI_LD})
#设置默认包含目录
include_directories (
${CGT_toolchain_DIR}/include
)
Link_directories (${CGT_toolchain_DIR}/lib)
#设置目标环境
设置(CMAKE_FIND_ROOT_PATH ${CGT_toolchain_DIR})
设置(CMAKE_make_program "D:/DMS/Radar/ccs/utils/bin/gmake 高速缓存路径"make Program")
#调整 find_XXX()命令的默认行为:
#-在主机环境中搜索程序
#-在目标环境中搜索标题和库
设置(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM 从不)
设置(仅限 CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
设置(仅限 CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
#特定目标 CPU 标志
#set (platform_config_C_flags "-mv7R4 -code_state=32 -float_support=VFPv3D16 -g -z"高速缓存字符串"platform config c flags")
#set (platform_config_CXX_flags "${platform_config_C_flags}"高速缓存字符串"platform config cxx flags")
#set (CMAKE_CXX_FLAGS "${platform_config_CXX_FLAGS}")
#set (CMAKE_C_FLAGS "${platform_config_C_flags}")
(小部分 CMAKELISTS
项目(雷达)
设置(CMAKE_VERSE_MAFILEE 打开)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-mv7R4 -code_state=16 -float_support=VFPv3D16 -me -O3 -g -gcc -diag_warning=225 -diag_wrap=off -display_error_number -gen_c_energ_energ=-eabi_subsections=-e4inflags=-enu_enu_abi_enp=-eabi_subsections=-ench_ench_enp=-enp=
设置(CMAKE_C_OUTPUT 扩展".oer4f")
add_executable (
HelloWorld.xer4f
HelloWorld.c)
target_link_libraries (helloworld.xer4f
-llibc.a
)