A method and device for compiling a module. The method includes: obtaining the list of dependent module libraries corresponding to the compiled module when the module is translated into the module directory, and the list of the dependent module library lists all the dependent module libraries that are dependent on the compiled module, which is dependent on the module library. It is associated with the dependent module, traversing the dependent module library in the list of the dependent module library, based on the dependent module associated with the dependent module library, looking up the path of the dependent module in the module list under the rotating directory, which records the path of all modules in the block list under the transferred directory. . The above scheme can effectively solve the problem of dependency between modules, improve the compilation efficiency, reduce the error rate of compilation, and facilitate the maintenance of software systems.
【技术实现步骤摘要】
一种编译模块的方法和装置
本专利技术涉及计算机
,特别是涉及一种编译模块的方法和装置。
技术介绍
对于大型软件项目来说,编译需要解决依赖性的问题,如果一个模块调用其他模块的应用程序接口(ApplicationProgrammingInterface,API),那么其他模块就是该模块的被依赖模块。模块间依赖性如果解决不好,可能出现编译某个模块通不过的情况。现有技术中,如果在待编译模块的目录下执行编译指令编译本模块,同时如果待编译模块的被依赖模块的库不存在时,那么编译是失败的,必须手动根据依赖关系严格按照顺序编译各模块,才能保证编译成功。然而现有技术的这种解决模块间依赖性的方法存在编译出错率高的问题,也不利于软件系统的维护。
技术实现思路
本专利技术解决的技术问题是提供一种编译模块的方法和装置,有效解决模块间依赖性问题,提高编译效率的同时减少编译的出错率,同时便于软件系统的维护。为了解决上述问题,本专利技术实施例提供一种编译模块的方法,所述方法包括:在模块目录下编译待编译模块时,获取所述待编译模块对应的被依赖模块库清单,其中,所述被依赖模块库清单列举有所述待编译模块 ...
【技术保护点】
1.一种编译模块的方法,其特征在于,包括:在模块目录下编译待编译模块时,获取所述待编译模块对应的被依赖模块库清单,其中,所述被依赖模块库清单列举有所述待编译模块依赖的全部被依赖模块库,所述被依赖模块库与被依赖模块关联;遍历所述被依赖模块库清单中的所述被依赖模块库,基于所述被依赖模块库关联的被依赖模块,在中转目录下的模块清单中查找所述被依赖模块的路径,所述中转目录下的模块清单中记录有全部模块的路径。
【技术特征摘要】
1.一种编译模块的方法,其特征在于,包括:在模块目录下编译待编译模块时,获取所述待编译模块对应的被依赖模块库清单,其中,所述被依赖模块库清单列举有所述待编译模块依赖的全部被依赖模块库,所述被依赖模块库与被依赖模块关联;遍历所述被依赖模块库清单中的所述被依赖模块库,基于所述被依赖模块库关联的被依赖模块,在中转目录下的模块清单中查找所述被依赖模块的路径,所述中转目录下的模块清单中记录有全部模块的路径。2.根据权利要求1所述的编译模块的方法,其特征在于,还包括:跳转到所述被依赖模块的路径下编译所述被依赖模块。3.根据权利要求1所述的编译模块的方法,其特征在于,在所述模块目录下编译所述待编译模块是通过执行第一编译命令触发的。4.根据权利要求1所述的编译模块的方法,其特征在于,遍历所述被依赖模块库清单中的所述被依赖模块库,基于所述被依赖模块库关联的被依赖模块,在中转目录下的模块清单中查找所述被依赖模块的路径包括:针对所述被依赖模块库清单中的每一被依赖模块执行第二编译命令;基于所述第二编译命令,跳转至所述中转目录,并在所述中转目录下针对所述被依赖模块执行第三编译命令;基于所述第三编译命令,在所述模块清单中查找所述被依赖模块的路径。5.根据权利要求1所述的编译模块的方法,其特征在于,还包括:根据所述被依赖模块的路径得到所述被依赖模块的头文件目录;将所述被依赖模块的头文件目录添加到所述待编译模块的被依赖模块头文件目录清单中,所述被依赖模块头文件目录清单用作编译时的命令选项。6.根据权利要求1所述的编译模块的方法,其特征在于,采用如下方式得到所述中转目录下的模块清单:搜索所述中转目录,将存在编译规则文件的模块的路径列入所述中转目录下的模块清单。7.一种编译模块的装置,其特征...
【专利技术属性】
技术研发人员:赵文恒,
申请(专利权)人:上海思立微电子科技有限公司,
类型:发明
国别省市:上海,31
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。