Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to compile Vala language project #1534

Closed
waruqi opened this issue Jul 27, 2021 · 4 comments
Closed

Support to compile Vala language project #1534

waruqi opened this issue Jul 27, 2021 · 4 comments

Comments

@waruqi waruqi added this to the v2.5.7 milestone Jul 27, 2021
@waruqi
Copy link
Member Author

waruqi commented Jul 29, 2021

#1538

@waruqi
Copy link
Member Author

waruqi commented Jul 29, 2021

add_rules("mode.release", "mode.debug")

add_requires("lua", "glib")

target("test")
    set_kind("binary")
    add_rules("vala")
    add_files("src/*.vala")
    add_packages("lua", "glib")
    add_values("vala.packages", "lua")

main.vala

using Lua;

static int my_func (LuaVM vm) {
    stdout.printf ("Vala Code From Lua Code! (%f)\n", vm.to_number (1));
    return 1;
}

static int main (string[] args) {

    string code = """
            print "Lua Code From Vala Code!"
            my_func(33)
        """;

    var vm = new LuaVM ();
    vm.open_libs ();
    vm.register ("my_func", my_func);
    vm.do_string (code);

    return 0;
}

@waruqi waruqi closed this as completed Jul 31, 2021
@waruqi
Copy link
Member Author

waruqi commented Aug 13, 2021

@waruqi
Copy link
Member Author

waruqi commented Aug 31, 2021

support libraries #1618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant