From 2a9b9611bd2058882afca2f6adc9234b25b8d2be Mon Sep 17 00:00:00 2001 From: LKedward Date: Tue, 15 Dec 2020 10:00:57 +0000 Subject: Fix: name collision between program objects Simplify object naming rules to avoid issue where programs in different top-level folders can have the same object file name. Fixes #305 --- fpm/src/fpm_targets.f90 | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fpm/src/fpm_targets.f90 b/fpm/src/fpm_targets.f90 index fb5a8ac..f0c4f63 100644 --- a/fpm/src/fpm_targets.f90 +++ b/fpm/src/fpm_targets.f90 @@ -139,9 +139,6 @@ subroutine targets_from_sources(model,sources) object_file = canon_path(source%file_name) - ! Ignore first directory level - object_file = object_file(index(object_file,filesep)+1:) - ! Convert any remaining directory separators to underscores i = index(object_file,filesep) do while(i > 0) @@ -149,18 +146,7 @@ subroutine targets_from_sources(model,sources) i = index(object_file,filesep) end do - select case(source%unit_scope) - - case (FPM_SCOPE_APP, FPM_SCOPE_EXAMPLE) - object_file = join_path(model%output_directory,'app',object_file)//'.o' - - case (FPM_SCOPE_TEST) - object_file = join_path(model%output_directory,'test',object_file)//'.o' - - case default - object_file = join_path(model%output_directory,model%package_name,object_file)//'.o' - - end select + object_file = join_path(model%output_directory,model%package_name,object_file)//'.o' end function get_object_name -- cgit v1.2.3