Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autodiscovery for case-insensitive filesystems #1007

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/fpm_sources.f90
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,with_f
! and apply any overrides
do j=1,size(sources)

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

Expand Down
19 changes: 18 additions & 1 deletion src/fpm_targets.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module fpm_targets

public FPM_TARGET_UNKNOWN, FPM_TARGET_EXECUTABLE, &
FPM_TARGET_ARCHIVE, FPM_TARGET_OBJECT, &
FPM_TARGET_C_OBJECT, FPM_TARGET_CPP_OBJECT
FPM_TARGET_C_OBJECT, FPM_TARGET_CPP_OBJECT, &
FPM_TARGET_NAME
public build_target_t, build_target_ptr
public targets_from_sources, resolve_module_dependencies
public add_target, add_dependency
Expand Down Expand Up @@ -137,6 +138,22 @@ module fpm_targets

contains

!> Target type name
pure function FPM_TARGET_NAME(type) result(msg)
integer, intent(in) :: type
character(:), allocatable :: msg

select case (type)
case (FPM_TARGET_ARCHIVE); msg = 'Archive'
case (FPM_TARGET_CPP_OBJECT); msg = 'C++ object'
case (FPM_TARGET_C_OBJECT); msg = 'C Object'
case (FPM_TARGET_EXECUTABLE); msg = 'Executable'
case (FPM_TARGET_OBJECT); msg = 'Object'
case default; msg = 'Unknown'
end select

end function FPM_TARGET_NAME

!> High-level wrapper to generate build target information
subroutine targets_from_sources(targets,model,prune,error)

Expand Down
Loading