@@ -481,16 +481,36 @@ logical function srcfile_is_same(this,that)
481
481
482
482
select type (other= >that)
483
483
type is (srcfile_t)
484
-
485
- if (.not. (this% file_name== other% file_name)) return
486
- if (.not. (this% exe_name== other% exe_name)) return
484
+ if (allocated (this% file_name).neqv. allocated (other% file_name)) return
485
+ if (allocated (this% file_name).and. allocated (other% file_name)) then
486
+ if (.not. (this% file_name== other% file_name)) return
487
+ end if
488
+ if (allocated (this% exe_name).neqv. allocated (other% exe_name)) return
489
+ if (allocated (this% exe_name).and. allocated (other% exe_name)) then
490
+ if (.not. (this% exe_name== other% exe_name)) return
491
+ end if
487
492
if (.not. (this% unit_scope== other% unit_scope)) return
488
- if (.not. (this% modules_provided== other% modules_provided)) return
493
+ if (allocated (this% modules_provided).neqv. allocated (other% modules_provided)) return
494
+ if (allocated (this% modules_provided).and. allocated (other% modules_provided)) then
495
+ if (.not. (this% modules_provided== other% modules_provided)) return
496
+ end if
489
497
if (.not. (this% unit_type== other% unit_type)) return
490
- if (.not. (this% parent_modules== other% parent_modules)) return
491
- if (.not. (this% modules_used== other% modules_used)) return
492
- if (.not. (this% include_dependencies== other% include_dependencies)) return
493
- if (.not. (this% link_libraries== other% link_libraries)) return
498
+ if (allocated (this% parent_modules).neqv. allocated (other% parent_modules)) return
499
+ if (allocated (this% parent_modules).and. allocated (other% parent_modules)) then
500
+ if (.not. (this% parent_modules== other% parent_modules)) return
501
+ end if
502
+ if (allocated (this% modules_used).neqv. allocated (other% modules_used)) return
503
+ if (allocated (this% modules_used).and. allocated (other% modules_used)) then
504
+ if (.not. (this% modules_used== other% modules_used)) return
505
+ end if
506
+ if (allocated (this% include_dependencies).neqv. allocated (other% include_dependencies)) return
507
+ if (allocated (this% include_dependencies).and. allocated (other% include_dependencies)) then
508
+ if (.not. (this% include_dependencies== other% include_dependencies)) return
509
+ end if
510
+ if (allocated (this% link_libraries).neqv. allocated (other% link_libraries)) return
511
+ if (allocated (this% link_libraries).and. allocated (other% link_libraries)) then
512
+ if (.not. (this% link_libraries== other% link_libraries)) return
513
+ end if
494
514
if (.not. (this% digest== other% digest)) return
495
515
496
516
class default
@@ -599,7 +619,10 @@ logical function fft_is_same(this,that)
599
619
600
620
if (.not. (this% implicit_typing.eqv. other% implicit_typing)) return
601
621
if (.not. (this% implicit_external.eqv. other% implicit_external)) return
602
- if (.not. (this% source_form== other% source_form)) return
622
+ if (allocated (this% source_form).neqv. allocated (other% source_form)) return
623
+ if (allocated (this% source_form).and. allocated (other% source_form)) then
624
+ if (.not. (this% source_form== other% source_form)) return
625
+ end if
603
626
604
627
class default
605
628
! Not the same type
@@ -666,9 +689,11 @@ logical function package_is_same(this,that)
666
689
667
690
select type (other= >that)
668
691
type is (package_t)
669
-
670
- if (.not. (this% name== other% name)) return
671
- if (.not. (allocated (this% sources).eqv. allocated (other% sources))) return
692
+ if (allocated (this% name).neqv. allocated (other% name)) return
693
+ if (allocated (this% name)) then
694
+ if (.not. (this% name== other% name)) return
695
+ end if
696
+ if (allocated (this% sources).neqv. allocated (other% sources)) return
672
697
if (allocated (this% sources)) then
673
698
if (.not. (size (this% sources)==size (other% sources))) return
674
699
do ii = 1 , size (this% sources)
@@ -677,7 +702,10 @@ logical function package_is_same(this,that)
677
702
end if
678
703
679
704
if (.not. (this% preprocess== other% preprocess)) return
680
- if (.not. (this% version== other% version)) return
705
+ if (allocated (this% version).neqv. allocated (other% version)) return
706
+ if (allocated (this% version)) then
707
+ if (.not. (this% version== other% version)) return
708
+ end if
681
709
682
710
! > Module naming
683
711
if (.not. (this% enforce_module_names.eqv. other% enforce_module_names)) return
@@ -851,7 +879,10 @@ logical function model_is_same(this,that)
851
879
select type (other= >that)
852
880
type is (fpm_model_t)
853
881
854
- if (.not. (this% package_name== other% package_name)) return
882
+ if ((allocated (this% package_name).neqv. allocated (other% package_name))) return
883
+ if (allocated (this% package_name).and. allocated (other% package_name)) then
884
+ if (.not. (this% package_name== other% package_name)) return
885
+ end if
855
886
if (.not. (allocated (this% packages).eqv. allocated (other% packages))) return
856
887
if (allocated (this% packages)) then
857
888
if (.not. (size (this% packages)==size (other% packages))) return
@@ -862,14 +893,38 @@ logical function model_is_same(this,that)
862
893
863
894
if (.not. (this% compiler== other% compiler)) return
864
895
if (.not. (this% archiver== other% archiver)) return
865
- if (.not. (this% fortran_compile_flags== other% fortran_compile_flags)) return
866
- if (.not. (this% c_compile_flags== other% c_compile_flags)) return
867
- if (.not. (this% cxx_compile_flags== other% cxx_compile_flags)) return
868
- if (.not. (this% link_flags== other% link_flags)) return
869
- if (.not. (this% build_prefix== other% build_prefix)) return
870
- if (.not. (this% include_dirs== other% include_dirs)) return
871
- if (.not. (this% link_libraries== other% link_libraries)) return
872
- if (.not. (this% external_modules== other% external_modules)) return
896
+ if (allocated (this% fortran_compile_flags).neqv. allocated (other% fortran_compile_flags)) return
897
+ if (allocated (this% fortran_compile_flags).and. allocated (other% fortran_compile_flags)) then
898
+ if (.not. (this% fortran_compile_flags== other% fortran_compile_flags)) return
899
+ end if
900
+ if (allocated (this% c_compile_flags).neqv. allocated (other% c_compile_flags)) return
901
+ if (allocated (this% c_compile_flags).and. allocated (other% c_compile_flags)) then
902
+ if (.not. (this% c_compile_flags== other% c_compile_flags)) return
903
+ end if
904
+ if (allocated (this% cxx_compile_flags).neqv. allocated (other% cxx_compile_flags)) return
905
+ if (allocated (this% cxx_compile_flags).and. allocated (other% cxx_compile_flags)) then
906
+ if (.not. (this% cxx_compile_flags== other% cxx_compile_flags)) return
907
+ end if
908
+ if (allocated (this% link_flags).neqv. allocated (other% link_flags)) return
909
+ if (allocated (this% link_flags).and. allocated (other% link_flags)) then
910
+ if (.not. (this% link_flags== other% link_flags)) return
911
+ end if
912
+ if (allocated (this% build_prefix).neqv. allocated (other% build_prefix)) return
913
+ if (allocated (this% build_prefix).and. allocated (other% build_prefix)) then
914
+ if (.not. (this% build_prefix== other% build_prefix)) return
915
+ end if
916
+ if (allocated (this% include_dirs).neqv. allocated (other% include_dirs)) return
917
+ if (allocated (this% include_dirs).and. allocated (other% include_dirs)) then
918
+ if (.not. (this% include_dirs== other% include_dirs)) return
919
+ end if
920
+ if (allocated (this% link_libraries).neqv. allocated (other% link_libraries)) return
921
+ if (allocated (this% link_libraries).and. allocated (other% link_libraries)) then
922
+ if (.not. (this% link_libraries== other% link_libraries)) return
923
+ end if
924
+ if (allocated (this% external_modules).neqv. allocated (other% external_modules)) return
925
+ if (allocated (this% external_modules).and. allocated (other% external_modules)) then
926
+ if (.not. (this% external_modules== other% external_modules)) return
927
+ end if
873
928
if (.not. (this% deps== other% deps)) return
874
929
if (.not. (this% include_tests.eqv. other% include_tests)) return
875
930
if (.not. (this% enforce_module_names.eqv. other% enforce_module_names)) return
0 commit comments