Add check arm_neon support 97/84397/2 accepted/tizen/3.0/common/20161114.105245 accepted/tizen/3.0/ivi/20161011.055302 accepted/tizen/3.0/mobile/20161015.032540 accepted/tizen/3.0/tv/20161016.003322 accepted/tizen/3.0/wearable/20161015.080306 accepted/tizen/common/20160824.154740 accepted/tizen/ivi/20160825.050409 accepted/tizen/mobile/20160825.050223 accepted/tizen/tv/20160825.050321 accepted/tizen/wearable/20160825.050345 submit/tizen/20160824.052737 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000005 submit/tizen_3.0_mobile/20161015.000001 submit/tizen_3.0_tv/20161015.000000 submit/tizen_3.0_wearable/20161015.000000
authorTae-Young Chung <ty83.chung@samsung.com>
Thu, 18 Aug 2016 10:18:01 +0000 (19:18 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Thu, 18 Aug 2016 10:44:36 +0000 (19:44 +0900)
Change-Id: I0a3b550bd3aaa0afef1c91230bb88b0116b1cb81
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
CMakeLists.txt
packaging/capi-media-vision.spec

index 5898b98..cd6895c 100644 (file)
@@ -91,10 +91,39 @@ FOREACH(flag ${${fw_name}_CFLAGS})
     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")
index 8707ca1..ea2be68 100644 (file)
@@ -1,7 +1,7 @@
 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
@@ -48,20 +48,14 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 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}