pass --with-our-malloc on MinGW

This commit is contained in:
tildearrow 2022-05-31 12:42:47 -05:00
parent 9b83bdc7b4
commit 74dcf69081
3 changed files with 10 additions and 0 deletions

View file

@ -92,6 +92,9 @@ if (SYSTEM_FFTW)
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FFTW_LDFLAGS}) list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FFTW_LDFLAGS})
message(STATUS "Using system-installed FFTW") message(STATUS "Using system-installed FFTW")
else() else()
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(WITH_OUR_MALLOC ON CACHE BOOL "aaa" FORCE)
endif()
add_subdirectory(extern/fftw EXCLUDE_FROM_ALL) add_subdirectory(extern/fftw EXCLUDE_FROM_ALL)
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/fftw/api) list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/fftw/api)
list(APPEND DEPENDENCIES_LIBRARIES fftw3) list(APPEND DEPENDENCIES_LIBRARIES fftw3)

View file

@ -16,6 +16,7 @@ option (BUILD_TESTS "Build tests" ON)
option (ENABLE_OPENMP "Use OpenMP for multithreading" OFF) option (ENABLE_OPENMP "Use OpenMP for multithreading" OFF)
option (ENABLE_THREADS "Use pthread for multithreading" OFF) option (ENABLE_THREADS "Use pthread for multithreading" OFF)
option (WITH_COMBINED_THREADS "Merge thread library" OFF) option (WITH_COMBINED_THREADS "Merge thread library" OFF)
option (WITH_OUR_MALLOC "Use own aligned malloc()/free() implementation" OFF)
option (ENABLE_FLOAT "single-precision" OFF) option (ENABLE_FLOAT "single-precision" OFF)
option (ENABLE_LONG_DOUBLE "long-double precision" OFF) option (ENABLE_LONG_DOUBLE "long-double precision" OFF)
@ -310,6 +311,9 @@ endif ()
add_library (${fftw3_lib} ${SOURCEFILES}) add_library (${fftw3_lib} ${SOURCEFILES})
target_include_directories (${fftw3_lib} INTERFACE $<INSTALL_INTERFACE:include>) target_include_directories (${fftw3_lib} INTERFACE $<INSTALL_INTERFACE:include>)
if (WITH_OUR_MALLOC)
target_compile_options (${fftw3_lib} PRIVATE WITH_OUR_MALLOC)
endif ()
if (MSVC AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Intel")) if (MSVC AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Intel"))
target_compile_definitions (${fftw3_lib} PRIVATE /bigobj) target_compile_definitions (${fftw3_lib} PRIVATE /bigobj)
endif () endif ()

3
extern/fftw/MODIFIED.md vendored Normal file
View file

@ -0,0 +1,3 @@
this is a modified version of FFTW for usage in Furnace.
it adds a `WITH_OUR_MALLOC` option to CMakeListst.txt, which was absent in the original release.