§
    ƒnóc  ã                  óZ   — d dl mZ d dlmZ d dlZdZdZdZdZdZ	d	Z
 G d
„ de¦  «        ZdS )é    )Úannotations)Ú
SampleImplNa�  #pragma once
#if defined _WIN32 || defined __CYGWIN__
  #ifdef BUILDING_{utoken}
    #define {utoken}_PUBLIC __declspec(dllexport)
  #else
    #define {utoken}_PUBLIC __declspec(dllimport)
  #endif
#else
  #ifdef BUILDING_{utoken}
      #define {utoken}_PUBLIC __attribute__ ((visibility ("default")))
  #else
      #define {utoken}_PUBLIC
  #endif
#endif

int {utoken}_PUBLIC {function_name}();

zæ#import <{header_file}>

/* This function will not be exported and is not
 * directly callable by users of this library.
 */
int internal_function() {{
    return 0;
}}

int {function_name}() {{
    return internal_function();
}}
zã#import <{header_file}>
#import <iostream>

int main(int argc, char **argv) {{
    if(argc != 1) {{
        std::cout << argv[0] << " takes no arguments." << std::endl;
        return 1;
    }}
    return {function_name}();
}}
aß  project('{project_name}', 'objcpp',
  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,
  objcpp_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)

# Make this library usable from the system's
# package manager.
install_headers('{header_file}', subdir : '{header_dir}')

pkg_mod = import('pkgconfig')
pkg_mod.generate(
  name : '{project_name}',
  filebase : '{ltoken}',
  description : 'Meson sample project.',
  subdirs : '{header_dir}',
  libraries : shlib,
  version : '{version}',
)
a+  #import <iostream>

#define PROJECT_NAME "{project_name}"

int main(int argc, char **argv) {{
    if(argc != 1) {{
        std::cout << argv[0] << " takes no arguments." << std::endl;
        return 1;
    }}
    std::cout << "This is project " << PROJECT_NAME << "." << std::endl;
    return 0;
}}
z½project('{project_name}', 'objcpp',
  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 )ÚObjCppProjectc                óx   •— t          ¦   «                              ¦   «          |j        | _        |j        | _        d S )N)ÚsuperÚ__init__ÚnameÚversion)ÚselfÚoptionsÚ	__class__s     €úF/usr/lib/python3/dist-packages/mesonbuild/templates/objcpptemplates.pyr	   zObjCppProject.__init__�   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]Ú_ú.mmÚwúutf-8©Úencoding)Úproject_nameúmeson.build)r   Úexe_nameÚsource_namer   )
ÚreÚsubr
   ÚlowerÚopenÚwriteÚhello_objcpp_templateÚformatÚhello_objcpp_meson_templater   )r   Úlowercase_tokenr   s      r   Úcreate_executablezObjCppProject.create_executable†   sÃ   € Ýœ& ¨s°D´I·O²OÑ4EÔ4EÑFÔFˆØ%¨Ñ-ˆÝˆ[˜#¨Ð0Ñ0Ô0×6Ò6Õ7L×7SÒ7SÐaeÔajÐ7SÑ7kÔ7kÑlÔlÐlÝˆ]˜C¨'Ð2Ñ2Ô2×8Ò8Ý'×.Ò.¸D¼IØ8GØ;FØ7;´|ð /ñ Eô Eñ	Fô 	Fð 	Fð 	Fð 	Fr   c                óœ  — t          j        dd| j                             ¦   «         ¦  «        }|                     ¦   «         }|dd…         dz   }|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¬¦  «                             t          j	        di |¤Ž¦  «         t          ddd¬¦  «                             t          j	        di |¤Ž¦  «         d S )Nr   r   r   é   Ú_funcÚ_testz.hr   z_test.mm)ÚutokenÚltokenÚ
header_dirÚfunction_nameÚheader_fileÚsource_fileÚtest_source_fileÚtest_exe_namer   Úlib_nameÚ	test_namer   r   r   r   r   © )r   r    r
   r!   Úupperr   r"   r#   Úlib_h_templater%   Úlib_objcpp_templateÚlib_objcpp_test_templateÚlib_objcpp_meson_template)	r   r'   Úuppercase_tokenr0   r4   Ú
lib_h_nameÚlib_objcpp_nameÚtest_objcpp_nameÚkwargss	            r   Úcreate_libraryzObjCppProject.create_library�   s�  € Ýœ& ¨s°D´I·O²OÑ4EÔ4EÑFÔFˆØ)×/Ò/Ñ1Ô1ˆØ'¨¨!¨Ô,¨wÑ6ˆØ'¨'Ñ1ˆØ$ tÑ+ˆ
Ø)¨EÑ1ˆØ*¨ZÑ7ÐØ+Ø+Ø /Ø#0Ø!+Ø!0Ø&6Ø#0Ø"&¤)Ø-Ø.Ø!œ\ðð ˆõ 	ˆZ˜ wÐ/Ñ/Ô/×5Ò5µnÔ6KÐ6UÐ6UÈfÐ6UÐ6UÑVÔVÐVÝˆ_˜c¨GÐ4Ñ4Ô4×:Ò:Õ;NÔ;UÐ;_Ð;_ÐX^Ð;_Ð;_Ñ`Ô`Ð`ÝÐ˜s¨WÐ5Ñ5Ô5×;Ò;Õ<TÔ<[Ð<eÐ<eÐ^dÐ<eÐ<eÑfÔfÐfÝˆ]˜C¨'Ð2Ñ2Ô2×8Ò8Õ9RÔ9YÐ9cÐ9cÐ\bÐ9cÐ9cÑdÔdÐdÐdÐdr   )r   r   )Ú__name__Ú
__module__Ú__qualname__r	   r(   rB   Ú__classcell__)r   s   @r   r   r   €   sl   ø€ € € € € ð'ð 'ð 'ð 'ð 'ð
Fð Fð Fð Fðeð eð eð eð eð eð eð er   r   )Ú
__future__r   Úmesonbuild.templates.sampleimplr   r   r9   r:   r;   r<   r$   r&   r   r7   r   r   ú<module>rI      s¢   ðð #Ð "Ð "Ð "Ð "Ð "à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 	€	€	€	ð€ð&Ð ð
Ð ð$Ð ðLÐ ðÐ ð(eð (eð (eð (eð (e�Jñ (eô (eð (eð (eð (er   