this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add cmake install + MSVC dll support

+42 -5
+22
CMakeLists.txt
··· 3 3 4 4 add_library(kissfft 5 5 kiss_fft.c) 6 + add_library(kissfft::kissfft ALIAS kissfft) 6 7 7 8 target_include_directories(kissfft PUBLIC 8 9 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> 9 10 $<INSTALL_INTERFACE:.>) 11 + 12 + set_target_properties(kissfft PROPERTIES 13 + DEFINE_SYMBOL KISS_FFT_BUILD) 14 + if(BUILD_SHARED_LIBS) 15 + target_compile_definitions(kissfft PUBLIC KISS_FFT_SHARED) 16 + set_target_properties(kissfft PROPERTIES 17 + C_VISIBILITY_PRESET hidden) 18 + endif() 19 + 20 + option(KISSFFT_INSTALL "Enable kissfft install" ON) 21 + if (KISSFFT_INSTALL) 22 + include(GNUInstallDirs) 23 + install(TARGETS kissfft EXPORT kissfft 24 + ARCHIVE DESTINATION "${CMAKE_INSTALL_BINDIR}" 25 + LIBRARY DESTINATION "${CMAKE_INSTALL_BINDIR}" 26 + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") 27 + install(FILES "kiss_fft.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 28 + install(EXPORT kissfft DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" 29 + NAMESPACE "kissfft::" 30 + FILE "${PROJECT_NAME}-config.cmake") 31 + endif()
+20 -5
kiss_fft.h
··· 14 14 #include <math.h> 15 15 #include <string.h> 16 16 17 + // Define KISS_FFT_SHARED macro to properly export symbols 18 + #ifdef KISS_FFT_SHARED 19 + # ifdef _WIN32 20 + # ifdef KISS_FFT_BUILD 21 + # define KISS_FFT_API __declspec(dllexport) 22 + # else 23 + # define KISS_FFT_API __declspec(dllimport) 24 + # endif 25 + # else 26 + # define KISS_FFT_API __attribute__ ((visibility ("default"))) 27 + # endif 28 + #else 29 + # define KISS_FFT_API 30 + #endif 31 + 17 32 #ifdef __cplusplus 18 33 extern "C" { 19 34 #endif ··· 99 114 * buffer size in *lenmem. 100 115 * */ 101 116 102 - kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem); 117 + kiss_fft_cfg KISS_FFT_API kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem); 103 118 104 119 /* 105 120 * kiss_fft(cfg,in_out_buf) ··· 111 126 * Note that each element is complex and can be accessed like 112 127 f[k].r and f[k].i 113 128 * */ 114 - void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout); 129 + void KISS_FFT_API kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout); 115 130 116 131 /* 117 132 A more generic version of the above function. It reads its input from every Nth sample. 118 133 * */ 119 - void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride); 134 + void KISS_FFT_API kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride); 120 135 121 136 /* If kiss_fft_alloc allocated a buffer, it is one contiguous 122 137 buffer and can be simply free()d when no longer needed*/ ··· 126 141 Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up 127 142 your compiler output to call this before you exit. 128 143 */ 129 - void kiss_fft_cleanup(void); 144 + void KISS_FFT_API kiss_fft_cleanup(void); 130 145 131 146 132 147 /* 133 148 * Returns the smallest integer k, such that k>=n and k has only "fast" factors (2,3,5) 134 149 */ 135 - int kiss_fft_next_fast_size(int n); 150 + int KISS_FFT_API kiss_fft_next_fast_size(int n); 136 151 137 152 /* for real ffts, we need an even size */ 138 153 #define kiss_fftr_next_fast_size_real(n) \