提交 26ea87cc 编写于 作者: N nihuini

do not define android macro for jetson, fix #2939

上级 61eb52e2
# set cross-compiled system type, it's better not use the type which cmake cannot recognized. set(CMAKE_SYSTEM_NAME Linux)
SET ( CMAKE_SYSTEM_NAME Linux ) set(CMAKE_SYSTEM_PROCESSOR aarch64)
SET ( CMAKE_SYSTEM_PROCESSOR aarch64 )
# for the reason of aarch64-linux-gnu-gcc DONOT need to be installed, make sure aarch64-linux-gnu-gcc and aarch64-linux-gnu-g++ can be found in $PATH: set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
SET ( CMAKE_C_COMPILER "aarch64-linux-gnu-gcc" ) set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
SET ( CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++" )
# set ${CMAKE_C_FLAGS} and ${CMAKE_CXX_FLAGS}flag for cross-compiled process # set ${CMAKE_C_FLAGS} and ${CMAKE_CXX_FLAGS}flag for cross-compiled process
# -march=armv8-a could work on Jetson, but will compile without some extra cpu features # -march=armv8-a could work on Jetson, but will compile without some extra cpu features
SET ( CMAKE_CXX_FLAGS "-std=c++11 -march=native -fopenmp ${CMAKE_CXX_FLAGS}" ) set(CMAKE_C_FLAGS "-march=native ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS}")
# other settings # cache flags
# Jetson CPU supports asimd set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
add_definitions ( -D__ARM_NEON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
# Jetson does NOT run ANDROID
# but `__ANDROID__` marco is tested before `__aarch64__`
# and currently no negative effect is caused by this marco
add_definitions( -D__ANDROID__)
SET ( ANDROID true)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册