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) option(WITH_SSE2 "Enable SSE2 optimization." OFF)
endif() endif()
if((TARGET_ARCH MATCHES "ARM") AND (NOT DEFINED WITH_NEON)) if(TARGET_ARCH MATCHES "ARM")
if (NOT DEFINED WITH_NEON)
option(WITH_NEON "Enable NEON optimization." ON) option(WITH_NEON "Enable NEON optimization." ON)
else() else()
option(WITH_NEON "Enable NEON optimization." OFF) 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() endif()
option(WITH_JPEG "Use JPEG decoding." OFF) option(WITH_JPEG "Use JPEG decoding." OFF)

View File

@ -76,7 +76,7 @@ if(WITH_NEON)
${ANDROID_CPU_FEATURES_PATH}/cpu-features.h) ${ANDROID_CPU_FEATURES_PATH}/cpu-features.h)
endif() endif()
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${${MODULE_PREFIX}_NEON_SRCS}) 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() endif()
if(WITH_JPEG) if(WITH_JPEG)

View File

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

View File

@ -85,7 +85,7 @@ if(WITH_SSE2)
endif() endif()
elseif(WITH_NEON) elseif(WITH_NEON)
if(CMAKE_COMPILER_IS_GNUCC) 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() endif()
# TODO: Add MSVC equivalent # TODO: Add MSVC equivalent
endif() endif()