--- a/testing/adios2/bindings/fortran/CMakeLists.txt
+++ b/testing/adios2/bindings/fortran/CMakeLists.txt
@@ -3,6 +3,10 @@
 # accompanying file Copyright.txt for details.
 #------------------------------------------------------------------------------#
 
+add_library(SmallTestData_f OBJECT SmallTestData_mod.F90)
+add_library(ISmallTestData_f INTERFACE)
+target_sources(ISmallTestData_f INTERFACE $<TARGET_OBJECTS:SmallTestData_f>)
+
 macro(fortran_add_test_helper testname mpi)
   set(test_targets "")
   if(NOT "${mpi}" MATCHES "^MPI_(ALLOW|ONLY|NONE)$")
@@ -85,10 +89,6 @@
   )
 endif()
 
-add_library(SmallTestData_f OBJECT SmallTestData_mod.F90)
-add_library(ISmallTestData_f INTERFACE)
-target_sources(ISmallTestData_f INTERFACE $<TARGET_OBJECTS:SmallTestData_f>)
-
 foreach(tgt
     ${Test.Bindings.Fortran.BPWriteTypes-TARGETS}
     ${Test.Bindings.Fortran.Remove-TARGETS}
