Skip to content

Commit

Permalink
Fortran: Set the correct linker language is used on all Fortran execu…
Browse files Browse the repository at this point in the history
…tables
  • Loading branch information
Chuck Atkins committed Dec 30, 2019
1 parent 83bcf11 commit 5c29bd5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
5 changes: 2 additions & 3 deletions cmake/install/post/adios2-config-dummy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ if(ADIOS2_HAVE_Fortran)
target_compile_definitions(with_Fortran PRIVATE WITH_ADIOS2)
target_link_libraries(with_Fortran adios2::adios2_f)

set_target_properties(without_Fortran with_Fortran
PROPERTIES
LINKER_LANGUAGE Fortran
set_target_properties(without_Fortran with_Fortran PROPERTIES
LINKER_LANGUAGE Fortran
)
endif()

Expand Down
8 changes: 4 additions & 4 deletions examples/hello/bpFWriteCRead/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ if(ADIOS2_HAVE_MPI)

if(ADIOS2_HAVE_Fortran)
add_executable(FWriter FWriter.f90)
target_link_libraries(FWriter adios2_f MPI::MPI_Fortran)
set_property(TARGET FWriter PROPERTY LINKER_LANGUAGE Fortran)

add_executable(FReader FReader.f90)
target_link_libraries(FWriter adios2_f MPI::MPI_Fortran)
target_link_libraries(FReader adios2_f MPI::MPI_Fortran)
set_property(TARGET FReader PROPERTY LINKER_LANGUAGE Fortran)
set_target_properties(FWriter FReader PROPERTIES
LINKER_LANGUAGE Fortran
)
endif()
endif()
4 changes: 2 additions & 2 deletions examples/hello/bpReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if(ADIOS2_HAVE_MPI)
if(ADIOS2_HAVE_Fortran)
add_executable(hello_bpReaderHeatMap3D_f helloBPReaderHeatMap3D.f90)
target_link_libraries(hello_bpReaderHeatMap3D_f adios2_f MPI::MPI_Fortran)
set_property(TARGET hello_bpReaderHeatMap3D_f
PROPERTY LINKER_LANGUAGE Fortran
set_target_properties(hello_bpReaderHeatMap3D_f PROPERTIES
LINKER_LANGUAGE Fortran
)
endif()

Expand Down
4 changes: 3 additions & 1 deletion examples/hello/bpWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ endif()
if(ADIOS2_HAVE_Fortran)
add_executable(hello_bpWriter_f helloBPWriter.F90)
target_link_libraries(hello_bpWriter_f adios2_f)
set_property(TARGET hello_bpWriter_f PROPERTY LINKER_LANGUAGE Fortran)
set_target_properties(hello_bpWriter_f PROPERTIES
LINKER_LANGUAGE Fortran
)
endif()

if(ADIOS2_HAVE_MPI)
Expand Down
1 change: 1 addition & 0 deletions testing/adios2/bindings/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ macro(fortran_add_test_helper testname mpi)
set(pfx Bindings.Fortran.)
set(tgt Test.${pfx}${testname})
add_executable(${tgt} Test${testname}.F90)
set_target_properties(${tgt} PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries(${tgt} adios2_f)
if(mpi)
target_compile_definitions(${tgt} PRIVATE USE_MPI)
Expand Down
14 changes: 11 additions & 3 deletions testing/adios2/engine/staging-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ add_executable(TestCommonServer TestCommonServer.cpp)
add_executable(TestCommonClient TestCommonClient.cpp)
if(ADIOS2_HAVE_Fortran)
add_library(TestCommonData_f OBJECT TestData_mod.F90)

add_executable(TestCommonWrite_f TestCommonWriteF.F90 $<TARGET_OBJECTS:TestCommonData_f>)
add_executable(TestCommonRead_f TestCommonReadF.F90 $<TARGET_OBJECTS:TestCommonData_f>)
add_executable(TestCommonWrite_f
TestCommonWriteF.F90
$<TARGET_OBJECTS:TestCommonData_f>
)
add_executable(TestCommonRead_f
TestCommonReadF.F90
$<TARGET_OBJECTS:TestCommonData_f>
)
set_target_properties(TestCommonWrite_f TestCommonRead_f PROPERTIES
LINKER_LANGUAGE Fortran
)
target_link_libraries(TestCommonWrite_f adios2_f)
target_link_libraries(TestCommonRead_f adios2_f)
endif()
Expand Down

0 comments on commit 5c29bd5

Please sign in to comment.