project('ptxmc', 'c', default_options : ['c_std=c11']) add_project_arguments('-D_GNU_SOURCE=1', language : [ 'c' ]) c_comp = meson.get_compiler('c') conf_data = configuration_data() if not c_comp.has_function_attribute('visibility:default') \ or not c_comp.has_function_attribute('visibility:hidden') error('Your platform isn\'t supported. Use a gcc-like compiler on linux.') else conf_data.set('PTX_EXPORT', '__attribute__((visibility("default")))') conf_data.set('PTX_IMPORT', 'extern') endif conf_data.set('HAS_ATTR_WUR', c_comp.has_function_attribute('warn_unused_result')) conf_data.set('HAS_ATTR_ALWAYS_INLINE', c_comp.has_function_attribute('always_inline')) conf_data.set('HAS_ATTR_MALLOC', c_comp.has_function_attribute('malloc')) conf_data.set('HAS_ATTR_FORMAT', c_comp.has_function_attribute('format')) conf_data.set('HAS_RESTRICT', c_comp.has_type('int *restrict')) configure_file(input : 'include/config.h.in', output : 'config.h', configuration : conf_data) add_project_dependencies( declare_dependency(include_directories : include_directories('.', 'include')), language : 'c' ) export_dynamic = [] if c_comp.get_argument_syntax() == 'gcc' if c_comp.has_argument('-fvisibility=hidden') add_project_arguments('-fvisibility=hidden', language : 'c') endif endif subdir('src') executable('ptxmc', prog_sources, gnu_symbol_visibility : 'hidden', export_dynamic : true) plugin_kwargs = { 'gnu_symbol_visibility' : 'hidden', 'c_args' : ['-DPTX_PLUGIN=1'], 'name_prefix' : 'm_', 'name_suffix' : 'ptxplugin' } subdir('plugins')