{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/unreal-plugin-multi-module-build/",
  "atlas": "https://www.pystone.net/?node=unreal-plugin-multi-module-build#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/unreal-plugin-multi-module-build.md",
  "context": "https://www.pystone.net/notes/unreal-plugin-multi-module-build.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:unreal-plugin-multi-module-build",
  "slug": "unreal-plugin-multi-module-build",
  "title": "Unreal Plugin多个模块开发与编译",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "Unreal Plugin多个模块开发与编译",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "1a7af6ddf0344ed4104d9c9b254374c88c358c92b7597b524187950534025d20",
  "assets": [
    {
      "reference": "assets/0013 - Unreal Plugin多个模块开发与编译__resource-002-9f2e6287b6ec.png",
      "url": "/media/31b84ad7e3b9f6357a80.png",
      "mediaType": "image/png",
      "contentHash": "31b84ad7e3b9f6357a806d7d66c9e3bc5877370c856edb62daa97a4d95393e01",
      "byteLength": 45604,
      "width": 967,
      "height": 413
    },
    {
      "reference": "assets/0013 - Unreal Plugin多个模块开发与编译__resource-001-1b805939569d.png",
      "url": "/media/1aa9e5e54933bf824759.png",
      "mediaType": "image/png",
      "contentHash": "1aa9e5e54933bf824759205f09d5d0059e73ae5c0c266982712ce624cff2b044",
      "byteLength": 24618,
      "width": 741,
      "height": 296
    },
    {
      "reference": "assets/0013 - Unreal Plugin多个模块开发与编译__resource-003-de6781a4ca95.png",
      "url": "/media/41bc4a99aed8d1f9d5b2.png",
      "mediaType": "image/png",
      "contentHash": "41bc4a99aed8d1f9d5b2a4b3f950efcc9ff70708d56254a98e8b941ff324ba3c",
      "byteLength": 15002,
      "width": 628,
      "height": 225
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "Unreal Plugin多个模块开发与编译",
      "anchor": "unreal-plugin多个模块开发与编译",
      "citation": "https://www.pystone.net/notes/unreal-plugin-multi-module-build/#unreal-plugin%E5%A4%9A%E4%B8%AA%E6%A8%A1%E5%9D%97%E5%BC%80%E5%8F%91%E4%B8%8E%E7%BC%96%E8%AF%91"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "Unreal中的“Unreal Plugin多个模块开发与编译”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#unreal"
    }
  ],
  "contentMarkdown": "# Unreal Plugin多个模块开发与编译\n\n﻿# Unreal Plugin多个模块开发与编译\n\n> 创建时间：2022/4/25 22:16\n\n要写与模块名称相同的Module类，实现StartupModule、ShutdownModule函数，模块才能加载进来。\n\n![](assets/0013 - Unreal Plugin多个模块开发与编译__resource-002-9f2e6287b6ec.png)\n\n模块的类型，如果要暴露给其他模块使用，要用 MODULENAME_API 来进行标记\n\n![](assets/0013 - Unreal Plugin多个模块开发与编译__resource-001-1b805939569d.png)\n\n模块之间互相引用只要使用 PublicDependencyModuleNames.AddRange 即可。\n\n至于说代码的头文件include，是否要添加PublicIncludePaths，取决于include的时候的方式，因为Paths是提供搜索的目标路径的，为了使搜索头文件的时候能搜索到。如果include命令保证头文件能搜索到就OK，如果搜索不到，就添加Public IncludePaths\n\nUnreal C++代码的的Compile是以Module为单位的，可以在Unreal Editor的UI上，点击Compile，单独对某个模块进行编译。\n\n![](assets/0013 - Unreal Plugin多个模块开发与编译__resource-003-de6781a4ca95.png)\n\nUI按钮的本质也是命令行语句，所以是存在语句用来编译单个模块的，只是现在还没有对RunUAT的命令行使用方法摸清楚，不知道如何编译单个模块。\n\n只要Compile，就会把模块的所有代码都进行编译，至于说Private和Public源码是否保留，看我们如何设定。\n\nPrivate和Public文件夹对于编译程序来说，并没有什么区别，只是对于开发者来设定的。Public一般是开源的部分。\n\nUnreal中插件通常的使用方式是，把代码编译好成dll、so等后，留下来一部分头文件，开放给用户，用户就可以在自己的工程当中引用这个头文件了。\n"
}
