From: Felipe Magno de Almeida Date: Wed, 31 Jul 2019 21:23:35 +0000 (-0300) Subject: eolian-cxx: Generate eot files X-Git-Tag: submit/tizen/20190805.083058~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48847ea03f3866edd94caecd538a7bb55383ccce;p=platform%2Fupstream%2Fefl.git eolian-cxx: Generate eot files Summary: Eolian Type files were not being generated, which made some template specialization to not be defined, for example for function_wrappers. Reviewers: bu5hm4n, woohyun, lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9468 --- diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc index 3774c49..1e08428 100644 --- a/src/bin/eolian_cxx/eolian_cxx.cc +++ b/src/bin/eolian_cxx/eolian_cxx.cc @@ -305,7 +305,26 @@ run(options_type const& opts) } else { - std::abort(); + if (!types_generate(base, opts, cpp_types_header)) + { + EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) + << "Error generating: " << ::eolian_class_short_name_get(klass) + << std::endl; + assert(false && "error generating class"); + } + else + { + std::ofstream header_decl; + header_decl.open(opts.out_file); + if (!header_decl.good()) + { + EINA_CXX_DOM_LOG_ERR(eolian_cxx::domain) + << "Can't open output file: " << opts.out_file << std::endl; + assert(false && "error opening file"); + } + std::copy (cpp_types_header.begin(), cpp_types_header.end() + , std::ostream_iterator(header_decl)); + } } } else @@ -336,6 +355,10 @@ run(options_type const& opts) headers.insert(filename + std::string(".hh")); eo_files.insert(filename); } + else + { + headers.insert (base + std::string(".hh")); + } } using efl::eolian::grammar::header_include_directive; diff --git a/src/bindings/cxx/meson.build b/src/bindings/cxx/meson.build index 3401a43..e62b7a2 100644 --- a/src/bindings/cxx/meson.build +++ b/src/bindings/cxx/meson.build @@ -39,6 +39,24 @@ foreach lib : cxx_sublibs #generate files for each .eo files foreach eo_file_subdir : eo_file_subdirs if eo_file_subdir != '' + cxx_pub_eot_files = get_variable(package_name + '_' + eo_file_subdir +'_eot_files') + else + cxx_pub_eot_files = get_variable(package_name +'_eot_files') + endif + subdir_file_location = join_paths(file_location, eo_file_subdir) + foreach cxx_gen_file : cxx_pub_eot_files + cxx_generator_target += custom_target('eolian_cxx_gen_'+cxx_gen_file.underscorify()+'', + input : join_paths(subdir_file_location, cxx_gen_file), + output : [cxx_gen_file + '.hh'], + install : true, + install_dir : join_paths(dir_include, package_version_name, eo_file_subdir), + command : [eolian_cxx_gen, '-I', meson.current_source_dir(), eolian_include_directories, + '-o', join_paths(meson.current_build_dir(), cxx_gen_file + '.hh'), + '@INPUT@']) + eo_file_list += files(join_paths(subdir_file_location, cxx_gen_file)) + endforeach + + if eo_file_subdir != '' cxx_pub_eo_files = get_variable(package_name + '_' + eo_file_subdir +'_eo_files') else cxx_pub_eo_files = get_variable(package_name +'_eo_files')