SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "-I./include -I./include/headers ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -w")
+SET(TEST_SRC_SUPPORT_ARM_NEON "
+#include <arm_neon.h>
+
+int main (int argc, char **argv) {
+float32x4_t acc = vdupq_n_f32(0.f);
+return 0;
+}
+")
+
+message("arch is ${ARCH}")
+INCLUDE(CheckCSourceCompiles)
+CHECK_C_SOURCE_COMPILES("${TEST_SRC_SUPPORT_ARM_NEON}" SUPPORT_NEON)
+IF(SUPPORT_NEON)
+ ADD_DEFINITIONS("-DENABLE_NEON")
+ELSE()
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfpu=neon")
+ message("CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
+
+ CHECK_C_SOURCE_COMPILES("${TEST_SRC_SUPPORT_ARM_NEON}" SUPPORT_NEON_)
+ message("Again check SUPPORT_NEON ${SUPPORT_NEON_}")
+ IF(SUPPORT_NEON_)
+ ADD_DEFINITIONS("-DENABLE_NEON")
+ IF("${ARCH}" STREQUAL "arm")
+ SET(NEON_CFLAGS "-mfpu=neon")
+ SET(NEON_CXXFLAGS "-mfpu=neon")
+ ENDIF()
+ ENDIF()
+ENDIF()
+
+SET(CMAKE_C_FLAGS "-I./include -I./include/headers ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${NEON_CFLAGS} -fPIC -Wall -w")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_CXX_FLAGS "-I./include -I./include/headers ${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fPIC")
+SET(CMAKE_CXX_FLAGS "-I./include -I./include/headers ${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} ${NEON_CXXFLAGS} -fPIC")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g --w")
IF("${ARCH}" STREQUAL "arm")
Name: capi-media-vision
Summary: Media Vision library for Tizen Native API
Version: 0.3.20
-Release: 3
+Release: 4
Group: Multimedia/Framework
License: Apache-2.0 and BSD-2.0
Source0: %{name}-%{version}.tar.gz
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
%endif
-%ifarch %{arm}
-export CFLAGS="$CFLAGS -DENABLE_NEON"
-export CXXFLAGS="$CXXFLAGS -DENABLE_NEON"
-%endif
-
-%ifarch %{aarch64}
-export CFLAGS="$CFLAGS -DENABLE_NEON"
-export CXXFLAGS="$CXXFLAGS -DENABLE_NEON"
-%endif
export CFLAGS+=" -DMV_CONFIG_PATH=\\\"%{TZ_SYS_RO_SHARE}/%{name}/\\\""
export CXXFLAGS+=" -DMV_CONFIG_PATH=\\\"%{TZ_SYS_RO_SHARE}/%{name}/\\\""
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_BIN=%TZ_SYS_BIN
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DTZ_SYS_BIN=%TZ_SYS_BIN \
+%ifarch %arm
+ -DARCH=arm
+%endif
make %{?jobs:-j%jobs}