[kissfft] Add new port (#9237)

* [kissfft] Add new port

* [kissfft] Update

* [kissfft] Update to 2020-03-20
This commit is contained in:
myd7349 2020-05-13 07:21:22 +08:00 committed by GitHub
parent ba7450abdd
commit 663a898bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,65 @@
cmake_minimum_required(VERSION 3.14)
project(kissfft LANGUAGES C)
include(GNUInstallDirs)
option(KF_USE_SIMD "Use SIMD" OFF)
option(KF_INSTALL_HEADERS "Install header files" ON)
if (KF_USE_SIMD)
set(KF_SCALAR_TYPE "__m128" CACHE STRING "Definition of kiss_fft_scalar")
else ()
set(KF_SCALAR_TYPE "float" CACHE STRING "Definition of kiss_fft_scalar")
endif ()
# TODO: FIXED_POINT
# TODO: -msse
set(kissfft_sources kiss_fft.c)
if (WIN32 AND BUILD_SHARED_LIBS)
list(APPEND kissfft_sources exports.def)
endif ()
add_library(kissfft ${kissfft_sources})
if (BUILD_SHARED_LIBS)
set_property(
TARGET kissfft
PROPERTY POSITION_INDEPENDENT_CODE ON
)
endif ()
target_include_directories(
kissfft
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(
kissfft
PUBLIC
$<$<BOOL:${KF_USE_SIMD}>:USE_SIMD>
kiss_fft_scalar=${KF_SCALAR_TYPE}
)
if (KF_INSTALL_HEADERS)
install(
FILES
_kiss_fft_guts.h
kiss_fft.h
kissfft.hh
kissfft_i32.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif ()
install(TARGETS kissfft EXPORT unofficial-kissfft-config)
install(
EXPORT unofficial-kissfft-config
NAMESPACE unofficial::kissfft::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-kissfft
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)

4
ports/kissfft/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: kissfft
Version: 2020-03-30
Homepage: https://github.com/mborgerding/kissfft
Description: A Fast Fourier Transform (FFT) library that tries to Keep it Simple, Stupid

View File

@ -0,0 +1,6 @@
EXPORTS
kiss_fft_alloc
kiss_fft
kiss_fft_stride
kiss_fft_cleanup
kiss_fft_next_fast_size

View File

@ -0,0 +1,30 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mborgerding/kissfft
REF 3f3fc6ab55da8610aba7fe89dcda09cf3a31f4e6
SHA512 5d3781a82d067cebd0a20c6b35a2d806598ba66f3bbf282c49a2ac9a6d09e1307dca1f8bc5fcc4c5955dc2f66aa94ca4dcfe00e6b31ea4694aa9d507f194554e
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/exports.def DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DKF_INSTALL_HEADERS=OFF
OPTIONS_RELEASE
-DKF_INSTALL_HEADERS=ON
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(
CONFIG_PATH lib/cmake/unofficial-${PORT}
TARGET_PATH share/unofficial-${PORT}
)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)