aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2020-12-15 10:00:57 +0000
committerLKedward <laurence.kedward@bristol.ac.uk>2020-12-15 10:00:57 +0000
commit2a9b9611bd2058882afca2f6adc9234b25b8d2be (patch)
tree22f6280f638b8f1486d78ab2b362367b33106ace
parent55db69e2ab29cb70c38cdb3335d4b2eaef6cc63d (diff)
downloadfpm-2a9b9611bd2058882afca2f6adc9234b25b8d2be.tar.gz
fpm-2a9b9611bd2058882afca2f6adc9234b25b8d2be.zip
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
-rw-r--r--fpm/src/fpm_targets.f9016
1 files changed, 1 insertions, 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