Skip to content

Commit

Permalink
tests/CMakeLists.txt: Fix interp/input mod deps and clean up target d…
Browse files Browse the repository at this point in the history
…efs (#253)

* tests/CMakeLists.txt: Fix interp/input mod deps and clean up target defs

* tests/CMakeLists.txt: remove redundant input lib compile from interp lib def
  • Loading branch information
AlexanderRichert-NOAA authored Aug 9, 2024
1 parent b4ad94a commit ab55010
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ foreach(kind ${kinds})
add_test(test_earth_radius_${kind} test_earth_radius_${kind})

# grib-2 tests
add_library(test_library_grib2_${kind} input_data_mod_grib2_${kind}.F90 interp_mod_grib2_${kind}.F90)
target_link_libraries(test_library_grib2_${kind} PUBLIC ip::ip_${kind})
target_compile_definitions(test_library_grib2_${kind} PRIVATE "LSIZE=${kind_definition}")
add_library(test_input_library_grib2_${kind} input_data_mod_grib2_${kind}.F90)
target_link_libraries(test_input_library_grib2_${kind} PUBLIC ip::ip_${kind})
target_compile_definitions(test_input_library_grib2_${kind} PUBLIC "LSIZE=${kind_definition}")
set_target_properties(test_input_library_grib2_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")
add_library(test_library_grib2_${kind} interp_mod_grib2_${kind}.F90)
target_link_libraries(test_library_grib2_${kind} PUBLIC test_input_library_grib2_${kind})
set_target_properties(test_library_grib2_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")

add_executable(tst_gdswzd_grib2_${kind} tst_gdswzd_grib2.c)
Expand All @@ -67,8 +70,6 @@ foreach(kind ${kinds})
add_executable(test_vector_grib2_${kind} test_vector_grib2.F90)
target_link_libraries(test_scalar_grib2_${kind} PRIVATE test_library_grib2_${kind})
target_link_libraries(test_vector_grib2_${kind} PRIVATE test_library_grib2_${kind})
target_compile_definitions(test_scalar_grib2_${kind} PRIVATE "LSIZE=${kind_definition}")
target_compile_definitions(test_vector_grib2_${kind} PRIVATE "LSIZE=${kind_definition}")
set_target_properties(test_scalar_grib2_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")
set_target_properties(test_vector_grib2_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")

Expand Down Expand Up @@ -112,9 +113,12 @@ foreach(kind ${kinds})
add_test(test_station_points_neighbor_budget_vector_grib2_${kind} test_vector_grib2_${kind} -1 6)

# grib-1 tests
add_library(test_library_grib1_${kind} input_data_mod_grib1_${kind}.F90 interp_mod_grib1_${kind}.F90)
target_link_libraries(test_library_grib1_${kind} PUBLIC ip::ip_${kind})
target_compile_definitions(test_library_grib1_${kind} PRIVATE "LSIZE=${kind_definition}")
add_library(test_input_library_grib1_${kind} input_data_mod_grib1_${kind}.F90)
target_link_libraries(test_input_library_grib1_${kind} PUBLIC ip::ip_${kind})
target_compile_definitions(test_input_library_grib1_${kind} PUBLIC "LSIZE=${kind_definition}")
set_target_properties(test_input_library_grib1_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")
add_library(test_library_grib1_${kind} interp_mod_grib1_${kind}.F90)
target_link_libraries(test_library_grib1_${kind} PUBLIC test_input_library_grib1_${kind})
set_target_properties(test_library_grib1_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")

add_executable(tst_gdswzd_grib1_${kind} tst_gdswzd_grib1.c)
Expand All @@ -126,8 +130,6 @@ foreach(kind ${kinds})
add_executable(test_vector_grib1_${kind} test_vector_grib1.F90)
target_link_libraries(test_scalar_grib1_${kind} PRIVATE test_library_grib1_${kind})
target_link_libraries(test_vector_grib1_${kind} PRIVATE test_library_grib1_${kind})
target_compile_definitions(test_scalar_grib1_${kind} PRIVATE "LSIZE=${kind_definition}")
target_compile_definitions(test_vector_grib1_${kind} PRIVATE "LSIZE=${kind_definition}")
set_target_properties(test_scalar_grib1_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")
set_target_properties(test_vector_grib1_${kind} PROPERTIES COMPILE_FLAGS "${fortran_${kind}_flags}")

Expand Down

0 comments on commit ab55010

Please sign in to comment.