@@ -22,7 +22,12 @@ module fpm_manifest_platform
22
22
23
23
public :: platform_config_t
24
24
public :: is_platform_key
25
-
25
+
26
+ ! > Shortcuts for the Intel OS variants
27
+ integer (compiler_enum), parameter :: &
28
+ id_intel_classic(* ) = [id_intel_classic_mac,id_intel_classic_nix,id_intel_classic_windows], &
29
+ id_intel_llvm (* ) = [id_intel_llvm_nix,id_intel_llvm_windows]
30
+
26
31
! > Serializable platform configuration (compiler + OS only)
27
32
type, extends(serializable_t) :: platform_config_t
28
33
@@ -109,7 +114,7 @@ function correct_compiler_for_os(compiler_id, os_type) result(corrected_id)
109
114
110
115
! Intel classic compilers: map to OS-specific version
111
116
select case (compiler_id)
112
- case (id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows)
117
+ case (id_intel_classic_mac,id_intel_classic_nix, id_intel_classic_windows)
113
118
select case (os_type)
114
119
case (OS_WINDOWS)
115
120
corrected_id = id_intel_classic_windows
@@ -119,7 +124,7 @@ function correct_compiler_for_os(compiler_id, os_type) result(corrected_id)
119
124
corrected_id = id_intel_classic_nix ! Fallback to unix version
120
125
end select
121
126
122
- case (id_intel_llvm_nix, id_intel_llvm_windows)
127
+ case (id_intel_llvm_nix,id_intel_llvm_windows)
123
128
select case (os_type)
124
129
case (OS_WINDOWS)
125
130
corrected_id = id_intel_llvm_windows
@@ -130,27 +135,32 @@ function correct_compiler_for_os(compiler_id, os_type) result(corrected_id)
130
135
131
136
end function correct_compiler_for_os
132
137
133
- ! > Check if two Intel compiler IDs are equivalent (same family, different OS versions)
134
- logical function intel_compilers_equivalent (compiler1 , compiler2 ) result(equivalent)
135
- integer (compiler_enum), intent (in ) :: compiler1, compiler2
138
+ ! > Check if a compiler ID is suitable for a target platform
139
+ ! > Handles special cases like Intel compiler variants
140
+ logical function compiler_is_suitable (compiler_id , target ) result(suitable)
141
+ integer (compiler_enum), intent (in ) :: compiler_id
142
+ type (platform_config_t), intent (in ) :: target
136
143
137
- equivalent = .false.
144
+ ! Default case: exact match or compiler_id is id_all
145
+ suitable = (compiler_id == id_all .or. compiler_id == target % compiler)
138
146
139
- ! Intel classic compilers are equivalent across OS variants
140
- if (any (compiler1 == [id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows]) .and. &
141
- any (compiler2 == [id_intel_classic_nix, id_intel_classic_mac, id_intel_classic_windows])) then
142
- equivalent = .true.
147
+ if (suitable) return
148
+
149
+ ! Intel classic compilers: all variants are equivalent
150
+ if (any (compiler_id == id_intel_classic) .and. any (target % compiler == id_intel_classic)) then
151
+ suitable = .true.
143
152
return
144
153
end if
145
154
146
- ! Intel LLVM compilers are equivalent across OS variants
147
- if (any (compiler1 == [id_intel_llvm_nix, id_intel_llvm_windows]) .and. &
148
- any (compiler2 == [id_intel_llvm_nix, id_intel_llvm_windows])) then
149
- equivalent = .true.
155
+ ! Intel LLVM compilers: all variants are equivalent
156
+ if (any (compiler_id == id_intel_llvm) .and. any (target % compiler == id_intel_llvm)) then
157
+ suitable = .true.
150
158
return
151
159
end if
152
160
153
- end function intel_compilers_equivalent
161
+ ! Future extensions can be added here for other compiler families
162
+
163
+ end function compiler_is_suitable
154
164
155
165
! > Compare two platform_config_t (semantic equality)
156
166
logical function platform_is_same (this , that )
@@ -247,8 +257,8 @@ logical function platform_is_suitable(self, target) result(ok)
247
257
ok = .false.
248
258
return
249
259
end if
250
-
251
- compiler_ok = any (self% compiler == [id_all, target % compiler] )
260
+
261
+ compiler_ok = compiler_is_suitable (self% compiler, target )
252
262
os_ok = any (self% os_type == [OS_ALL,target % os_type])
253
263
254
264
! Basic matching
0 commit comments