forked from conda-forge/amrex-feedstock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply AMReX-Codes/amrex#4293 to fix conda-forge/impactx-feedstock#42
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From c6ee9704d892c18a21877920c43f07b542a03894 Mon Sep 17 00:00:00 2001 | ||
From: Axel Huebl <axel.huebl@plasma.ninja> | ||
Date: Sat, 11 Jan 2025 17:23:29 -0800 | ||
Subject: [PATCH] Fix `AMReX::FFTW` Once | ||
|
||
In situations like superbuilds or other downstream usage, | ||
the `AMReX::FFTW` should only be created once. | ||
--- | ||
Tools/CMake/FindAMReXFFTW.cmake | 14 ++++++++------ | ||
1 file changed, 8 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/Tools/CMake/FindAMReXFFTW.cmake b/Tools/CMake/FindAMReXFFTW.cmake | ||
index 64ce7183f3..1306ae77b8 100644 | ||
--- a/Tools/CMake/FindAMReXFFTW.cmake | ||
+++ b/Tools/CMake/FindAMReXFFTW.cmake | ||
@@ -102,9 +102,6 @@ if(NOT AMReX_FFTW_SEARCH IN_LIST AMReX_FFTW_SEARCH_VALUES) | ||
endif() | ||
mark_as_advanced(AMReX_FFTW_SEARCH) | ||
|
||
-# Create imported target | ||
-add_library(AMReX::FFTW INTERFACE IMPORTED GLOBAL) | ||
- | ||
function(fftw_find_precision HFFTWp) | ||
if(AMReX_FFTW_SEARCH STREQUAL CMAKE) | ||
find_package(FFTW3${HFFTWp} CONFIG REQUIRED) | ||
@@ -138,9 +135,14 @@ function(fftw_find_precision HFFTWp) | ||
endif() | ||
endfunction() | ||
|
||
-# floating point precision suffixes: we request float and double precision | ||
-fftw_find_precision("") | ||
-fftw_find_precision("f") | ||
+if(NOT TARGET AMReX::FFTW) | ||
+ # Create imported target | ||
+ add_library(AMReX::FFTW INTERFACE IMPORTED GLOBAL) | ||
+ | ||
+ # floating point precision suffixes: we request float and double precision | ||
+ fftw_find_precision("") | ||
+ fftw_find_precision("f") | ||
+endif() | ||
|
||
# Vars for CMake config | ||
include(FindPackageHandleStandardArgs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters