@@ -12,7 +12,6 @@ add_rules("mode.debug", "mode.releasedbg")
1212
1313-- include subprojects
1414includes (" lib/commonlib-shared" )
15- includes (" xmake-rules.lua" )
1615
1716-- define targets
1817target (" commonlibf4" , function ()
@@ -42,3 +41,28 @@ target("commonlibf4", function()
4241 -- set precompiled header
4342 set_pcxxheader (" include/F4SE/Impl/PCH.h" )
4443end )
44+
45+ rule (" commonlibf4.plugin" , function ()
46+ add_deps (" commonlib.plugin" )
47+
48+ on_load (function (target )
49+ target :data_set (" commonlib.plugin.config" , target :extraconf (" rules" , " commonlibf4.plugin" ))
50+ target :data_set (" commonlib.plugin.package" , { prefixdir = " Data" })
51+ end )
52+
53+ on_config (function (target )
54+ target :add (" deps" , " commonlibf4" )
55+
56+ target :add (" configfiles" , path.join (os.scriptdir (), " res/commonlibf4-plugin.cpp.in" ))
57+ target :add (" files" , path.join (target :configdir (), " commonlibf4-plugin.cpp" ))
58+
59+ if os.getenv (" XSE_FO4_MODS_PATH" ) then
60+ target :set (" installdir" , path.join (os.getenv (" XSE_FO4_MODS_PATH" ), target :name ()))
61+ elseif os.getenv (" XSE_FO4_GAME_PATH" ) then
62+ target :set (" installdir" , path.join (os.getenv (" XSE_FO4_GAME_PATH" ), " Data" ))
63+ end
64+
65+ target :add (" installfiles" , target :targetfile (), { prefixdir = " F4SE/Plugins" })
66+ target :add (" installfiles" , target :symbolfile (), { prefixdir = " F4SE/Plugins" })
67+ end )
68+ end )
0 commit comments