diff options
author | danfe <danfe@FreeBSD.org> | 2016-01-13 21:34:07 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2016-01-13 21:34:07 +0800 |
commit | 192af06b8ee728db6eb417809280fb9385bac9a8 (patch) | |
tree | 0f70ee2371fe93e72b99c6dd019b2a08b853eb91 /graphics/lensfun | |
parent | 925bca316d27a4ee1dad57d7540a469c97d740e7 (diff) | |
download | freebsd-ports-gnome-192af06b8ee728db6eb417809280fb9385bac9a8.tar.gz freebsd-ports-gnome-192af06b8ee728db6eb417809280fb9385bac9a8.tar.zst freebsd-ports-gnome-192af06b8ee728db6eb417809280fb9385bac9a8.zip |
- Limit -msse/-msse2 to files that actually use intrinsics
- Limit SSE/SSE2 optimizations to x86 CPUs (exposed as SIMD option)
PR: 205006
Diffstat (limited to 'graphics/lensfun')
-rw-r--r-- | graphics/lensfun/Makefile | 11 | ||||
-rw-r--r-- | graphics/lensfun/files/patch-CMakeLists.txt | 36 | ||||
-rw-r--r-- | graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt | 14 |
3 files changed, 47 insertions, 14 deletions
diff --git a/graphics/lensfun/Makefile b/graphics/lensfun/Makefile index da7d609d5439..779f526609c6 100644 --- a/graphics/lensfun/Makefile +++ b/graphics/lensfun/Makefile @@ -3,7 +3,7 @@ PORTNAME= lensfun PORTVERSION= 0.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= SF/${PORTNAME}/${PORTVERSION} @@ -19,13 +19,10 @@ USE_GNOME= glib20 USE_LDCONFIG= yes CMAKE_ARGS= -DBUILD_AUXFUN:BOOL=ON -DINSTALL_HELPER_SCRIPTS:BOOL=OFF -.if ! ${MACHINE_CPU:Msse} == "sse" -CMAKE_ARGS+= -DBUILD_FOR_SSE:BOOL=OFF -.endif +OPTIONS_DEFINE= SIMD +OPTIONS_DEFAULT= SIMD -.if ! ${MACHINE_CPU:Msse2} == "sse2" -CMAKE_ARGS+= -DBUILD_FOR_SSE2:BOOL=OFF -.endif +SIMD_CMAKE_OFF= -DBUILD_FOR_SSE:BOOL=OFF -DBUILD_FOR_SSE2:BOOL=OFF post-patch: @${REINPLACE_CMD} -e '/pkgconfig/s,$${LIBDIR},libdata,' \ diff --git a/graphics/lensfun/files/patch-CMakeLists.txt b/graphics/lensfun/files/patch-CMakeLists.txt index aa0ae96253fa..9a2b83e119d0 100644 --- a/graphics/lensfun/files/patch-CMakeLists.txt +++ b/graphics/lensfun/files/patch-CMakeLists.txt @@ -1,24 +1,46 @@ --- CMakeLists.txt.orig 2014-09-30 17:37:34 UTC +++ CMakeLists.txt -@@ -46,15 +46,11 @@ ENDIF() +@@ -28,12 +28,18 @@ IF(NOT HAVE_REGEX_H) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/regex) + ENDIF() + ++IF(CMAKE_SYSTEM_PROCESSOR MATCHES "[XxIi][0-9]?86|[Aa][Mm][Dd]64") ++ SET(X86_ON ON) ++else() ++ SET(X86_ON OFF) ++ENDIF() ++ + # options controlling the build process + OPTION(BUILD_STATIC "Build static library" OFF) + OPTION(BUILD_TESTS "Build test programs" OFF) + OPTION(BUILD_AUXFUN "Build auxfun library (requires libpng)" OFF) +-OPTION(BUILD_FOR_SSE "Build with support for SSE" ON) +-OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ON) ++OPTION(BUILD_FOR_SSE "Build with support for SSE" ${X86_ON}) ++OPTION(BUILD_FOR_SSE2 "Build with support for SSE2" ${X86_ON}) + OPTION(BUILD_DOC "Build documentation with doxygen" OFF) + OPTION(INSTALL_HELPER_SCRIPTS "Install various helper scripts" ON) + +@@ -46,14 +52,14 @@ ENDIF() IF(BUILD_FOR_SSE) SET(VECTORIZATION_SSE 1) - IF(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse") -- ENDIF() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse") ++ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ SET(VECTORIZATION_SSE_FLAGS "-msse") + ENDIF() ENDIF() IF(BUILD_FOR_SSE2) SET(VECTORIZATION_SSE2 1) - IF(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") -- ENDIF() -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") ++ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ SET(VECTORIZATION_SSE2_FLAGS "-msse2") + ENDIF() ENDIF() - IF(WIN32) -@@ -68,6 +64,7 @@ ENDIF() +@@ -68,6 +74,7 @@ ENDIF() # find dependencies FIND_PACKAGE(GLIB2 REQUIRED) INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS}) diff --git a/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt b/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt new file mode 100644 index 000000000000..9a96f7f2d4fd --- /dev/null +++ b/graphics/lensfun/files/patch-libs_lensfun_CMakeLists.txt @@ -0,0 +1,14 @@ +--- libs/lensfun/CMakeLists.txt.orig 2014-09-30 17:37:34 UTC ++++ libs/lensfun/CMakeLists.txt +@@ -9,6 +9,11 @@ IF(WIN32) + LIST(APPEND LENSFUN_SRC windows/auxfun.cpp) + ENDIF() + ++SET_SOURCE_FILES_PROPERTIES(mod-color-sse.cpp mod-coord-sse.cpp ++ PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE_FLAGS}") ++SET_SOURCE_FILES_PROPERTIES(mod-color-sse2.cpp ++ PROPERTIES COMPILE_FLAGS "${VECTORIZATION_SSE2_FLAGS}") ++ + IF(BUILD_STATIC) + ADD_LIBRARY(lensfun STATIC ${LENSFUN_SRC}) + ELSE() |