浏览代码

[cpp] Add explicitly declared depends to normal class files

Hugh Sanderson 6 年之前
父节点
当前提交
2d99bdcac6
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/generators/gencpp.ml

+ 5 - 0
src/generators/gencpp.ml

@@ -4630,6 +4630,11 @@ let path_of_string path =
 *)
 let find_referenced_types_flags ctx obj field_name super_deps constructor_deps header_only for_depends include_super_args =
    let types = ref PMap.empty in
+   if for_depends then begin
+      let include_file = get_meta_string_path (t_infos obj).mt_meta Meta.Depend in
+      if (include_file<>"") then
+         types := (PMap.add ( path_of_string include_file ) true !types);
+   end;
    let rec add_type_flag isNative in_path =
       if ( not (PMap.mem in_path !types)) then begin
          types := (PMap.add in_path isNative !types);