diff --git a/src/fpm_sources.f90 b/src/fpm_sources.f90 index 69c724eec6..4c779d5bfa 100644 --- a/src/fpm_sources.f90 +++ b/src/fpm_sources.f90 @@ -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 diff --git a/src/fpm_targets.f90 b/src/fpm_targets.f90 index 7c8c97b775..bcf5235ab0 100644 --- a/src/fpm_targets.f90 +++ b/src/fpm_targets.f90 @@ -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 @@ -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)