diff options
| -rw-r--r-- | ports/fftw3/CONTROL | 3 | ||||
| -rw-r--r-- | ports/fftw3/omp_test.patch | 17 | ||||
| -rw-r--r-- | ports/fftw3/portfile.cmake | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/ports/fftw3/CONTROL b/ports/fftw3/CONTROL index a0ed88124..55cd702d2 100644 --- a/ports/fftw3/CONTROL +++ b/ports/fftw3/CONTROL @@ -1,3 +1,6 @@ Source: fftw3
Version: 3.3.8
Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).
+
+Feature: openmp
+Description: Builds openmp enabled lib
\ No newline at end of file diff --git a/ports/fftw3/omp_test.patch b/ports/fftw3/omp_test.patch new file mode 100644 index 000000000..6123798a2 --- /dev/null +++ b/ports/fftw3/omp_test.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f3cfc20..9826bff 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -385,6 +385,12 @@ if (BUILD_TESTS)
+ target_link_libraries (bench ${fftw3_lib})
+ endif ()
+
++ if (ENABLE_OPENMP)
++ target_link_libraries (bench ${fftw3_lib}_omp)
++ else ()
++ target_link_libraries (bench ${fftw3_lib})
++ endif ()
++
+
+ enable_testing ()
+
diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake index ca3201ec3..4efb47075 100644 --- a/ports/fftw3/portfile.cmake +++ b/ports/fftw3/portfile.cmake @@ -17,12 +17,25 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE})
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/omp_test.patch
+)
+
+if ("openmp" IN_LIST FEATURES)
+ set(ENABLE_OPENMP ON)
+else()
+ set(ENABLE_OPENMP OFF)
+endif()
+
foreach(PRECISION ENABLE_DEFAULT_PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-D${PRECISION}=ON
+ -DENABLE_OPENMP=${ENABLE_OPENMP}
)
vcpkg_install_cmake()
|
