From 74dcf6908123534def35cac52589a334718220e4 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 31 May 2022 12:42:47 -0500 Subject: [PATCH] pass --with-our-malloc on MinGW --- CMakeLists.txt | 3 +++ extern/fftw/CMakeLists.txt | 4 ++++ extern/fftw/MODIFIED.md | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 extern/fftw/MODIFIED.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cd16396..bbaf81eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,9 @@ if (SYSTEM_FFTW) list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FFTW_LDFLAGS}) message(STATUS "Using system-installed FFTW") 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) list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/fftw/api) list(APPEND DEPENDENCIES_LIBRARIES fftw3) diff --git a/extern/fftw/CMakeLists.txt b/extern/fftw/CMakeLists.txt index 3eb96aaa..369e665d 100644 --- a/extern/fftw/CMakeLists.txt +++ b/extern/fftw/CMakeLists.txt @@ -16,6 +16,7 @@ option (BUILD_TESTS "Build tests" ON) option (ENABLE_OPENMP "Use OpenMP for multithreading" OFF) option (ENABLE_THREADS "Use pthread for multithreading" 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_LONG_DOUBLE "long-double precision" OFF) @@ -310,6 +311,9 @@ endif () add_library (${fftw3_lib} ${SOURCEFILES}) target_include_directories (${fftw3_lib} INTERFACE $) +if (WITH_OUR_MALLOC) + target_compile_options (${fftw3_lib} PRIVATE WITH_OUR_MALLOC) +endif () if (MSVC AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Intel")) target_compile_definitions (${fftw3_lib} PRIVATE /bigobj) endif () diff --git a/extern/fftw/MODIFIED.md b/extern/fftw/MODIFIED.md new file mode 100644 index 00000000..0dcc2a62 --- /dev/null +++ b/extern/fftw/MODIFIED.md @@ -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.