eolian-cxx: Generate eot files
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>
Wed, 31 Jul 2019 21:23:35 +0000 (18:23 -0300)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 5 Aug 2019 02:19:57 +0000 (11:19 +0900)
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

src/bin/eolian_cxx/eolian_cxx.cc
src/bindings/cxx/meson.build

index 3774c49..1e08428 100644 (file)
@@ -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<char>(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;
index 3401a43..e62b7a2 100644 (file)
@@ -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')