From f70a1fa14ca74fbd2c9f399a9b27087982363728 Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Fri, 9 Aug 2024 09:40:18 -0700 Subject: [PATCH 1/2] tests/CMakeLists.txt: Fix interp/input mod deps and clean up target defs --- tests/CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 93553b8f..9d6dc737 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -53,9 +53,12 @@ foreach(kind ${kinds}) add_test(test_earth_radius_${kind} test_earth_radius_${kind}) # grib-2 tests + 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} 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}") + 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) @@ -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}") @@ -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) @@ -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}") From e9f143f9afdb11243cbb8dcb6f9b0865f77fb6e8 Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Fri, 9 Aug 2024 10:35:30 -0700 Subject: [PATCH 2/2] tests/CMakeLists.txt: remove redundant input lib compile from interp lib def --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9d6dc737..2585001d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -57,7 +57,7 @@ foreach(kind ${kinds}) 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} input_data_mod_grib2_${kind}.F90 interp_mod_grib2_${kind}.F90) + 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}")