From 04f1dcb8dcd36bb0473737f7fdab1163c9e1b1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Tue, 20 Aug 2024 22:47:27 +0200 Subject: [PATCH] cmake: exclude fortran/finufftfort.cpp by default This should only be compiled if `FINUFFT_BUILD_FORTRAN` is set to `ON`. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d16783eec..e56e9523a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,13 @@ endif() # double precision The single precision compilation is done with -DSINGLE set(FINUFFT_PRECISION_DEPENDENT_SOURCES src/finufft.cpp src/fft.cpp src/simpleinterfaces.cpp src/spreadinterp.cpp - src/utils.cpp fortran/finufftfort.cpp) + src/utils.cpp) + +# If we're building for Fortran, make sure we also include the translation +# layer. +if(FINUFFT_BUILD_FORTRAN) + list(APPEND FINUFFT_PRECISION_DEPENDENT_SOURCES fortran/finufftfort.cpp) +endif() # set linker flags for sanitizer set(FINUFFT_SANITIZER_FLAGS)