diff options
| -rw-r--r-- | tests/projects/kotlin-native/static/src/main.kt | 3 | ||||
| -rw-r--r-- | tests/projects/kotlin-native/static/xmake.lua | 7 | ||||
| -rw-r--r-- | xmake/rules/kotlin-native/xmake.lua | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/projects/kotlin-native/static/src/main.kt b/tests/projects/kotlin-native/static/src/main.kt new file mode 100644 index 000000000..543f5ac8f --- /dev/null +++ b/tests/projects/kotlin-native/static/src/main.kt @@ -0,0 +1,3 @@ +fun main() { + println("hello xmake!") +} diff --git a/tests/projects/kotlin-native/static/xmake.lua b/tests/projects/kotlin-native/static/xmake.lua new file mode 100644 index 000000000..2e827ec78 --- /dev/null +++ b/tests/projects/kotlin-native/static/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") +add_requires("kotlin-native") +target("test") + set_kind("static") + add_files("src/*.kt") + set_toolchains("@kotlin-native") + diff --git a/xmake/rules/kotlin-native/xmake.lua b/xmake/rules/kotlin-native/xmake.lua index f917a06a3..a75cc8062 100644 --- a/xmake/rules/kotlin-native/xmake.lua +++ b/xmake/rules/kotlin-native/xmake.lua @@ -20,6 +20,11 @@ rule("kotlin-native.build") set_sourcekinds("kc") + on_load(function (target) + if target:is_static() then + target:add("kcflags", {"-produce", "static"}, {force = true}) + end + end) on_build("build.target") rule("kotlin-native") |
