commit 3f4938648950a7f3bf9a19c320ca9fae7c52de20 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Mon May 13 13:44:23 2024 +0800 [feat] cviruntime opensource for cv18xx soc. - a4b6a3, add cumsum and gatherelements_pt.
40 lines
1.6 KiB
CMake
40 lines
1.6 KiB
CMake
include(CMakeForceCompiler)
|
|
|
|
# The Generic system name is used for embedded targets (targets without OS) in
|
|
# CMake
|
|
set( CMAKE_SYSTEM_NAME Linux )
|
|
set( CMAKE_SYSTEM_PROCESSOR arm )
|
|
set( ARCH arm )
|
|
set( CROSS_COMPILE arm-cvitek-linux-uclibcgnueabihf-)
|
|
|
|
set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc)
|
|
set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++)
|
|
|
|
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
|
|
message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
|
|
|
|
# To build the tests, we need to set where the target environment containing
|
|
# the required library is. On Debian-like systems, this is
|
|
SET(CMAKE_FIND_ROOT_PATH ${ARM_SYSROOT_PATH})
|
|
# search for programs in the build host directories
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
# for libraries and headers in the target directories
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
# We must set the OBJCOPY setting into cache so that it's available to the
|
|
# whole project. Otherwise, this does not get set into the CACHE and therefore
|
|
# the build doesn't know what the OBJCOPY filepath is
|
|
set(CMAKE_OBJCOPY ${CROSS_COMPILE}objcopy
|
|
CACHE FILEPATH "The toolchain objcopy command " FORCE )
|
|
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "" )
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "" )
|
|
set( CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "" )
|
|
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv7-a -mfpu=neon" )
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard -marm" )
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a -mfpu=neon" )
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=hard -marm" )
|