Skip to content

Configuration

Qudix edited this page Oct 21, 2024 · 1 revision

This template further simplifies the creation of plugins by integrating with XMake.

xmake.lua

This file is what XMake looks for and executes when run in the project folder. In this template it defines the project, the default settings, required dependencies, and the target for our SFSE plugin. For more details on the XMake API you can refer to the xmake.io website.

Here are things you should be concerned with:

set_project("commonlibsf-template")
  • This sets the project scope and name, and is displayed in the resulting .dll's file details tab.
set_version("0.0.0")
  • This sets the default project version, and is displayed in the resulting .dll's file details tab. This can be overriden on a target-by-target basis.
set_languages("c++23")
  • This sets the default project languages. This can be overriden on a target-by-target basis.
target("commonlibsf-template")
  • The target specifies the scope of the program to compile, in this case a shared library for use with skse. The name corresponds to the name of the file that will be generated (commonlibsf-template.dll).
target("commonlibsf-template")
...
    add_rules("commonlibsf.plugin", {
        name = "commonlibsf-template",
        author = "qudix",
        description = "SFSE plugin template using CommonLibSF"
    })
  • This rule does most of the hard work of setting up the plugin and generating required files. Various options can be set as seen above:

    Option Type Description Default Size
    name string Used by other plugins to find its plugin handle (Required) 256
    author string Name of the author(s) "" 256
    description string Description of the plugin's purpose or function "" 256

xmake-requires.lock

This file is automatically generated by XMake and defines the locking of dependencies and their versions. This is useful for keeping builds consistent across machines. Do not edit this file directly, use the upgrade command xmake requires --upgrade to upgrade all dependencies to the latest versions (where possible) or specify the version range.

Clone this wiki locally