Merge pull request #987 from bmiklautz/fpu_type

build/arm: added build option to specify fp ABI
This commit is contained in:
Marc-André Moreau 2013-02-19 16:28:45 -08:00
commit 0e19c92a20
4 changed files with 15 additions and 7 deletions

View File

@ -17,10 +17,18 @@ else()
option(WITH_SSE2 "Enable SSE2 optimization." OFF)
endif()
if((TARGET_ARCH MATCHES "ARM") AND (NOT DEFINED WITH_NEON))
option(WITH_NEON "Enable NEON optimization." ON)
else()
option(WITH_NEON "Enable NEON optimization." OFF)
if(TARGET_ARCH MATCHES "ARM")
if (NOT DEFINED WITH_NEON)
option(WITH_NEON "Enable NEON optimization." ON)
else()
option(WITH_NEON "Enable NEON optimization." OFF)
endif()
if (NOT DEFINED ARM_FP_ABI)
set(ARM_FP_ABI "softfp" CACHE STRING "Floating point ABI to use on arm")
else()
set(ARM_FP_ABI ${ARM_FP_API} CACHE STRING "Floating point ABI to use on arm")
endif()
mark_as_advanced(ARM_FP_ABI)
endif()
option(WITH_JPEG "Use JPEG decoding." OFF)

View File

@ -76,7 +76,7 @@ if(WITH_NEON)
${ANDROID_CPU_FEATURES_PATH}/cpu-features.h)
endif()
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${${MODULE_PREFIX}_NEON_SRCS})
set_source_files_properties(${${MODULE_PREFIX}_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon -mfloat-abi=softfp -Wno-unused-variable")
set_source_files_properties(${${MODULE_PREFIX}_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon -mfloat-abi=${ARM_FP_ABI} -Wno-unused-variable")
endif()
if(WITH_JPEG)

View File

@ -49,7 +49,7 @@ if(WITH_SSE2)
endif()
elseif(WITH_NEON)
if(CMAKE_COMPILER_IS_GNUCC)
set(OPTIMIZATION "${OPTIMIZATION} -mfpu=neon -mfloat-abi=softfp")
set(OPTIMIZATION "${OPTIMIZATION} -mfpu=neon -mfloat-abi=${ARM_FP_ABI}")
endif()
# TODO: Add MSVC equivalent
endif()

View File

@ -85,7 +85,7 @@ if(WITH_SSE2)
endif()
elseif(WITH_NEON)
if(CMAKE_COMPILER_IS_GNUCC)
set(OPTIMZATION "${OPTFLAGS} -mfpu=neon -mfloat-abi=softfp -O2")
set(OPTIMZATION "${OPTFLAGS} -mfpu=neon -mfloat-abi=${ARM_FP_ABI} -O2")
endif()
# TODO: Add MSVC equivalent
endif()