rename "lua.version" to "VERSION"
[liba.git] / javascript / xmake.lua
blob92f2cf8ae72bc20dc12c7f09c4f41785467551c4
1 ---@diagnostic disable
2 -- option: liba-wasm
3 option("liba-wasm")
4 set_showmenu(true)
5 set_category("liba")
6 set_default(is_plat("wasm") or false)
7 set_description("Enable/Disable JavaScript WebAssembly")
8 option_end()
10 -- option: liba-wasm-async
11 option("liba-wasm-async")
12 set_default(false)
13 set_showmenu(true)
14 set_category("liba")
15 set_description("Enable/Disable JavaScript Async")
16 option_end()
18 -- option: liba-wasm-bigint
19 option("liba-wasm-bigint")
20 set_default(false)
21 set_showmenu(true)
22 set_category("liba")
23 set_description("Enable/Disable JavaScript BigInt")
24 option_end()
26 if get_config("liba-wasm") and is_plat("wasm") then
27 target("ajs")
28 set_kind("binary")
29 add_files("src/**.cc")
30 if not has_config("liba-wasm") then
31 add_ldflags("-sWASM=0")
32 end
33 if not has_config("liba-wasm-async") then
34 add_ldflags("-sWASM_ASYNC_COMPILATION=0")
35 end
36 if has_config("liba-wasm-bigint") then
37 add_ldflags("-sWASM_BIGINT")
38 add_defines("WASM_BIGINT")
39 end
40 set_filename("liba.js")
41 add_syslinks("embind")
42 set_targetdir(".")
43 add_deps("a")
44 target_end()
45 end