Skip to content

Commit b19c29a

Browse files
authored
Fix autodiscovery for case-insensitive filesystems (#1007)
Fix autodiscovery for case-insensitive filesystems
2 parents ad16060 + 912c85a commit b19c29a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/fpm_sources.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,with_f
199199
! and apply any overrides
200200
do j=1,size(sources)
201201

202-
if (basename(sources(j)%file_name,suffix=.true.) == executables(i)%main .and.&
202+
!> Compare lowercase strings to allow auto-discovery of pre-processed extensions
203+
if (lower(basename(sources(j)%file_name,suffix=.true.)) == lower(executables(i)%main) .and.&
203204
canon_path(dirname(sources(j)%file_name)) == &
204205
canon_path(executables(i)%source_dir) ) then
205206

src/fpm_targets.f90

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ module fpm_targets
4040

4141
public FPM_TARGET_UNKNOWN, FPM_TARGET_EXECUTABLE, &
4242
FPM_TARGET_ARCHIVE, FPM_TARGET_OBJECT, &
43-
FPM_TARGET_C_OBJECT, FPM_TARGET_CPP_OBJECT
43+
FPM_TARGET_C_OBJECT, FPM_TARGET_CPP_OBJECT, &
44+
FPM_TARGET_NAME
4445
public build_target_t, build_target_ptr
4546
public targets_from_sources, resolve_module_dependencies
4647
public add_target, add_dependency
@@ -137,6 +138,22 @@ module fpm_targets
137138

138139
contains
139140

141+
!> Target type name
142+
pure function FPM_TARGET_NAME(type) result(msg)
143+
integer, intent(in) :: type
144+
character(:), allocatable :: msg
145+
146+
select case (type)
147+
case (FPM_TARGET_ARCHIVE); msg = 'Archive'
148+
case (FPM_TARGET_CPP_OBJECT); msg = 'C++ object'
149+
case (FPM_TARGET_C_OBJECT); msg = 'C Object'
150+
case (FPM_TARGET_EXECUTABLE); msg = 'Executable'
151+
case (FPM_TARGET_OBJECT); msg = 'Object'
152+
case default; msg = 'Unknown'
153+
end select
154+
155+
end function FPM_TARGET_NAME
156+
140157
!> High-level wrapper to generate build target information
141158
subroutine targets_from_sources(targets,model,prune,error)
142159

0 commit comments

Comments
 (0)