Skip to content

Skyrim Scripting vcpkg / xmake packages

License

Notifications You must be signed in to change notification settings

SkyrimScripting/Packages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skyrim Packages

Note: I plan to add vcpkg support in the future, but for now, only xmake is supported for most packages.

xmake

Configure repository

To use these xmake packages, add the following to your xmake.lua file:

add_repositories("SkyrimScripting https://github.com/SkyrimScripting/Packages.git")

Available Skyrim Packages

  • skyrim-commonlib
  • skyrim-commonlib-vr
  • skyrim-commonlib-ng
  • skyrim-commonlib-ae
  • skyrim-commonlib-se
  • Other packages in this repo are a work in progress and I wouldn't use them yet!

CommonLib

xmake packages available:

  • skyrim-commonlib ( Alias for skyrim-commonlib-ng )
  • skyrim-commonlib-vr ( Adds dependency on @alandtse's CommonLibVR )
  • skyrim-commonlib-ng ( Adds dependency on @CharmedBaryon's CommonLibSSE-NG )
  • skyrim-commonlib-ae ( Adds dependency on @powerof3's CommonLibSSE configured for Skyrim 1.6+ compatibility )
  • skyrim-commonlib-se ( Adds dependency on @powerof3's CommonLibSSE configured for Skyrim 1.5.97 compatibility )

Basic Usage

skyrim-commonlib

To use one of these CommonLib packages:

add_requires("skyrim-commonlib")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")
    add_rules("@skyrim-commonlib/plugin")

skyrim-commonlib-vr (or any other package)

Or any of the other packages listed above:

-- For example, to use the VR version of CommonLib:
add_requires("skyrim-commonlib-vr")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    -- This will add the CommonLibVR dependency
    add_packages("skyrim-commonlib-vr")
    -- And don't forget to add the rules for the plugin
    add_rules("@skyrim-commonlib-vr/plugin")

SKSE Plugin metadata

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")
    add_rules("@skyrim-commonlib/plugin", {
        name = "My-SKSE-Plugin", -- This defaults to the target name
        version = "420.1.69", -- This defaults to the target version or "0.0.0"
        author = "Mrowr Purr",
        email = "[email protected]",
        mods_folder = os.getenv("MO2_or_VORTEX_mods_folder_path"),
        mod_files = {"Scripts", "", "AnythingToDeployToTheModFolder"}
    })

Xbyak Support

To enable xbyak support, enable the xybak option (available for any version):

add_requires("skyrim-commonlib", { configs = { xbyak = true } })

This will provide the following function (which is otherwise unavailable):

SKSE::Trampoline::allocate(Xbyak::CodeGenerator& codeGenerator)

Mod Folder Deployment

mods_folder

Optionally, you can define one or more "mods" folders to deploy the plugin dll/pdb to:

add_requires("skyrim-commonlib")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")

    add_rules("@skyrim-commonlib/plugin", {
        -- This will output to the following generated folder location:
        --  C:/Path/to/my/mods/My-SKSE-Plugin/SKSE/Plugins/My-SKSE-Plugin.dll
        mods_folder = "C:/Path/to/my/mods"
    })

    -- Note: use the rule with a name matching the package that you are using:
    -- add_rules("@skyrim-commonlib/plugin", {...
    -- add_rules("@skyrim-commonlib-vr/plugin", {...
    -- add_rules("@skyrim-commonlib-ae/plugin", {...
    -- add_rules("@skyrim-commonlib-se/plugin", {...
    -- add_rules("@skyrim-commonlib-vr/plugin", {...

If you have multiple mods folders, you can specify them as a list:

add_requires("skyrim-commonlib")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")
    add_rules("@skyrim-commonlib/plugin", {
        mod_folders = { "C:/...", "C:/..." }
    })

Paths containing a ; are split, allowing for use of an environment varialbe to specify multiple output paths:

add_requires("skyrim-commonlib")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")
    add_rules("@skyrim-commonlib/plugin", {
        mod_folders = os.getenv("SKYRIM_MOD_FOLDERS")
    })

mod_files

You can also specify additional files to deploy to the mod folder:

add_requires("skyrim-commonlib")

target("My-SKSE-Plugin")
    add_files("plugin.cpp")
    add_packages("skyrim-commonlib")
    add_rules("@skyrim-commonlib/plugin", {
        mod_files = { "Scripts", "", "AnythingToDeployToTheModFolder" }
    })

xmake configuration based on official CommonLibSSE-NG xmake package configuration: https://github.com/xmake-io/xmake-repo License: Apache 2.0

Configuration above was authored by by Qudix (https://github.com/Qudix)

Modifications were made to the original code

About

Skyrim Scripting vcpkg / xmake packages

Resources

License

Code of conduct

Stars

Watchers

Forks