最近更新了CMake从2.8.1开始的3.7.1版本,它运行良好。
更新需要从工具链文件中删除已弃用的CMAKE_FORCE_C_COMPILER
命令,该文件用于跳过对正常工作的编译器的自动检查。
我尝试设置变量SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
以跳过测试,但行为没有变化。
现在似乎需要检查,CMake无法识别我的编译器(TriCore_v6.0r1)。
错误讯息:
在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.elf"
中找不到C编译器标识在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.map"
中找不到C编译器标识在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.mdf"
中找不到C编译器标识在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.o"
中找不到C编译器标识编译C编译器识别源文件" CMakeCCompilerId.c"失败。 编译器:C:/TASKING/TriCore_v6.0r1/ctc/bin/cctc.exe 建立标志: Id标志:-Aa
注意:根据用法,编译器不接受此标志(-Aa)
输出结果为:
1
ctc E200:命令行:选项" -A":无效的子选项" a"
在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.elf"
中找不到C编译器标识在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.map"
中找不到C编译器标识在" C:/Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.mdf"
中找不到C编译器标识使用""检查C编译器是否为IAR。不匹配" IAR。+编译器":
理想情况下,我希望识别编译器,但由于Altium不支持CMake工具,如果它解决了我的问题并且允许我再次成功构建,我会决定跳过这些检查。 / p>
工具链文件:
#################################
# CMake Tool Chain File
# for TASKING Build Environment
#################################
# Deprecated!
# INCLUDE(CMakeForceCompiler)
# Skip CMake’s checks for a working compiler by omitting compilation of CMakeCCompilerId.c
# SET(CMAKE_C_COMPILER_ID "Tasking")
# Try to force the compiler
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
# Use of "Generic", because target system is an embedded device
SET(CMAKE_SYSTEM_NAME Generic)
SET(CMAKE_SYSTEM_VERSION 1)
SET(can_use_assembler TRUE)
# Specify the cross compiler
SET(CCPATH $ENV{TASKING_PATH})
SET(CC "${CCPATH}/ctc/bin/cctc.exe")
SET(CXX "${CCPATH}/ctc/bin/cctc.exe")
SET(CMAKE_AR "${CCPATH}/ctc/bin/artc.exe" CACHE FILEPATH "Archiver")
# Deprecated!
# Force CMake to use the specified cross compiler
# CMAKE_FORCE_C_COMPILER (${CC} ctc)
# CMAKE_FORCE_CXX_COMPILER (${CXX} ctc)
SET(CCVERBOSE "")
# Specify compiler call notation and compiler flags
SET(CMAKE_C_COMPILE_OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/bin/perl.exe ${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/compliation_manager.pl <CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE> -c")
# Specify linker call notation and linker flags
#SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -r -o <TARGET>")
#The Call to the perl script to manage the cross core linking, and will call the linker and scripts for updating the symbols
SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/bin/perl.exe ${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/linking_manager.pl -DListOfObjects <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl--output=${PROJECT_NAME}.hex:IHEX:4,linear")
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#Commented as previously used for Greenhills
#SET (MAP_OPTIONS "-map=${PROJECT_NAME}.map -Ml -Mu -Mx -keepmap")
SET (CORE0_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=1 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=0 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403")
SET (CORE0_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core0-TRICORE-tasking.lsl")
SET (CORE0_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c2038bfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_ca2b8bdbb8_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a")
SET (CORE0_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=0 -Wl--define=PreLink=ON -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE0_LIB} -Wl-OCLtxY -Wl--error-limit=0 --map-file-format=+lsl --library=fp_fpu -d ${CORE0_LINK_FILE}" )
SET (CORE1_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=0 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=1 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403")
SET (CORE1_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core1-TRICORE-tasking.lsl")
SET (CORE1_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c203cbfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a")
SET (CORE1_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=1 -Wl--define=PreLink=ON -DSPM_PATH=${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/application/cvc/obj/ -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE1_LIB} -Wl-OCLtxY -Wl--error-limit=0 --user-provided-initialization-code --library=fp_fpu -d ${CORE1_LINK_FILE}")
SET (CORE2_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=0 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=2 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403")
SET (CORE2_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core2-TRICORE-tasking.lsl")
SET (CORE2_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c203cbfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a ")
SET (CORE2_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=2 -Wl--define=PreLink=ON -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE2_LIB} -Wl-OCLtxY -Wl--error-limit=0 -Wl--user-provided-initialization-code --library=fp_fpu -d ${CORE2_LINK_FILE}")
答案 0 :(得分:1)
感谢所有回复的人!
正如@Florian建议的那样,可以通过设置变量来强制编译器
SET(CMAKE_C_COMPILER_WORKS TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_WORKS TRUE CACHE INTERNAL "")
但是,我也注意到上述变量是未设置,但没有以下内容:
SET(CMAKE_C_COMPILER_FORCED TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_FORCED TRUE CACHE INTERNAL "")
最后,需要设置另一对变量以防止尝试识别编译器:
SET(CMAKE_C_COMPILER_ID_RUN TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE CACHE INTERNAL "")