From f5d208c3aba4759bf2246d91a26d19d00603d2d1 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 2 Apr 2024 00:56:45 +0800 Subject: add module.binary/shared rules --- tests/projects/other/native_module/modules/binary/bar/xmake.lua | 2 +- tests/projects/other/native_module/xmake.lua | 2 +- xmake/rules/module/xmake.lua | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/projects/other/native_module/modules/binary/bar/xmake.lua b/tests/projects/other/native_module/modules/binary/bar/xmake.lua index 7b3ea4032..8f4526071 100644 --- a/tests/projects/other/native_module/modules/binary/bar/xmake.lua +++ b/tests/projects/other/native_module/modules/binary/bar/xmake.lua @@ -1,7 +1,7 @@ add_rules("mode.debug", "mode.release") target("bar") - set_kind("binary") + add_rules("module.binary") add_files("src/*.cpp") diff --git a/tests/projects/other/native_module/xmake.lua b/tests/projects/other/native_module/xmake.lua index 9327d7407..628248534 100644 --- a/tests/projects/other/native_module/xmake.lua +++ b/tests/projects/other/native_module/xmake.lua @@ -3,7 +3,7 @@ add_rules("mode.debug", "mode.release") add_moduledirs("modules") target("test") - add_rules("module.binary") + set_kind("binary") add_files("src/*.cpp") on_config(function (target) -- import("shared.foo") diff --git a/xmake/rules/module/xmake.lua b/xmake/rules/module/xmake.lua index a5c3a1d3b..a3bc9b54f 100644 --- a/xmake/rules/module/xmake.lua +++ b/xmake/rules/module/xmake.lua @@ -20,11 +20,15 @@ rule("module.binary") on_load(function (target) + import("core.project.config") target:set("kind", "binary") + target:set("targetdir", config.buildir()) end) rule("module.shared") on_load(function (target) + import("core.project.config") target:set("kind", "shared") + target:set("targetdir", config.buildir()) end) -- cgit v1.3.1