§
    ƒnóc¦  ã                  óV   — d dl mZ d dlmZ d dlZdZdZdZdZdZ	 G d	„ d
e¦  «        Z
dS )é    )Úannotations)Ú
SampleImplNa‡  
! This procedure will not be exported and is not
! directly callable by users of this library.

module modfoo

implicit none
private
public :: {function_name}

contains

integer function internal_function()
    internal_function = 0
end function internal_function

integer function {function_name}()
    {function_name} = internal_function()
end function {function_name}

end module modfoo
z4
use modfoo

print *,{function_name}()

end program
af  project('{project_name}', 'fortran',
  version : '{version}',
  default_options : ['warning_level=3'])

# These arguments are only used to build the shared library
# not the executables that use the library.
lib_args = ['-DBUILDING_{utoken}']

shlib = shared_library('{lib_name}', '{source_file}',
  install : true,
  fortran_args : lib_args,
  gnu_symbol_visibility : 'hidden',
)

test_exe = executable('{test_exe_name}', '{test_source_file}',
  link_with : shlib)
test('{test_name}', test_exe)

# Make this library usable as a Meson subproject.
{ltoken}_dep = declare_dependency(
  include_directories: include_directories('.'),
  link_with : shlib)

pkg_mod = import('pkgconfig')
pkg_mod.generate(
  name : '{project_name}',
  filebase : '{ltoken}',
  description : 'Meson sample project.',
  subdirs : '{header_dir}',
  libraries : shlib,
  version : '{version}',
)
z†
implicit none

character(len=*), parameter :: PROJECT_NAME = "{project_name}"

print *,"This is project ", PROJECT_NAME

end program
z¾project('{project_name}', 'fortran',
  version : '{version}',
  default_options : ['warning_level=3'])

exe = executable('{exe_name}', '{source_name}',
  install : true)

test('basic', exe)
c                  ó.   ‡ — e Zd Zˆ fd„Zdd„Zdd„Zˆ xZS )ÚFortranProjectc                óx   •— t          ¦   «                              ¦   «          |j        | _        |j        | _        d S )N)ÚsuperÚ__init__ÚnameÚversion)ÚselfÚoptionsÚ	__class__s     €úG/usr/lib/python3/dist-packages/mesonbuild/templates/fortrantemplates.pyr	   zFortranProject.__init__j   s/   ø€ Ý‰Œ×ÒÑÔÐØ”LˆŒ	Ø”ˆŒˆˆó    ÚreturnÚNonec                ó†  — t          j        dd| j                             ¦   «         ¦  «        }|dz   }t	          |dd¬¦  «                             t                               | j        ¬¦  «        ¦  «         t	          ddd¬¦  «                             t                               | j        ||| j	        ¬	¦  «        ¦  «         d S )
Nú	[^a-z0-9]Ú_ú.f90Úwúutf-8©Úencoding)Úproject_nameúmeson.build)r   Úexe_nameÚsource_namer   )
ÚreÚsubr
   ÚlowerÚopenÚwriteÚhello_fortran_templateÚformatÚhello_fortran_meson_templater   )r   Úlowercase_tokenr   s      r   Úcreate_executablez FortranProject.create_executableo   sÃ   € Ýœ& ¨s°D´I·O²OÑ4EÔ4EÑFÔFˆØ%¨Ñ.ˆÝˆ[˜#¨Ð0Ñ0Ô0×6Ò6Õ7M×7TÒ7TÐbfÔbkÐ7TÑ7lÔ7lÑmÔmÐmÝˆ]˜C¨'Ð2Ñ2Ô2×8Ò8Ý(×/Ò/¸T¼YØ9HØ<GØ8<¼ð 0ñ Fô Fñ	Gô 	Gð 	Gð 	Gð 	Gr   c                ó(  — t          j        dd| j                             ¦   «         ¦  «        }|                     ¦   «         }|dd…         dz   }|dz   }|dz   }|dz   }|||||||| j        ||| j        d	œ}t          |d
d¬¦  «                             t          j	        di |¤Ž¦  «         t          |d
d¬¦  «                             t          j	        di |¤Ž¦  «         t          dd
d¬¦  «                             t          j	        di |¤Ž¦  «         d S )Nr   r   r   é   Ú_funcÚ_testr   z	_test.f90)ÚutokenÚltokenÚ
header_dirÚfunction_nameÚsource_fileÚtest_source_fileÚtest_exe_namer   Úlib_nameÚ	test_namer   r   r   r   r   © )r   r    r
   r!   Úupperr   r"   r#   Úlib_fortran_templater%   Úlib_fortran_test_templateÚlib_fortran_meson_template)r   r'   Úuppercase_tokenr0   r3   Úlib_fortran_nameÚtest_fortran_nameÚkwargss           r   Úcreate_libraryzFortranProject.create_libraryy   sB  € Ýœ& ¨s°D´I·O²OÑ4EÔ4EÑFÔFˆØ)×/Ò/Ñ1Ô1ˆØ'¨¨!¨Ô,¨wÑ6ˆØ'¨'Ñ1ˆØ*¨VÑ3ÐØ+¨kÑ9ÐØ+Ø+Ø /Ø#0Ø!1Ø&7Ø#0Ø"&¤)Ø-Ø.Ø!œ\ðð ˆõ 	Ð˜s¨WÐ5Ñ5Ô5×;Ò;Õ<PÔ<WÐ<aÐ<aÐZ`Ð<aÐ<aÑbÔbÐbÝÐ ¨gÐ6Ñ6Ô6×<Ò<Õ=VÔ=]Ð=gÐ=gÐ`fÐ=gÐ=gÑhÔhÐhÝˆ]˜C¨'Ð2Ñ2Ô2×8Ò8Õ9SÔ9ZÐ9dÐ9dÐ]cÐ9dÐ9dÑeÔeÐeÐeÐer   )r   r   )Ú__name__Ú
__module__Ú__qualname__r	   r(   r?   Ú__classcell__)r   s   @r   r   r   i   sl   ø€ € € € € ð'ð 'ð 'ð 'ð 'ð
Gð Gð Gð Gðfð fð fð fð fð fð fð fr   r   )Ú
__future__r   Úmesonbuild.templates.sampleimplr   r   r8   r9   r:   r$   r&   r   r6   r   r   ú<module>rF      s›   ðð #Ð "Ð "Ð "Ð "Ð "à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 	€	€	€	ðÐ ð.Ð ð Ð ðDÐ ð Ð ð%fð %fð %fð %fð %f�Zñ %fô %fð %fð %fð %fr   