Skip to content

Commit

Permalink
inih: remove use prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Feb 28, 2024
1 parent 9c05583 commit f502680
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/i/inih/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_rules("mode.debug", "mode.release")

option("with_ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"})
option("use_heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"})
option("ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"})
option("heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"})
option("max_line_length", {description = "maximum line length in bytes", default = "200", type = "string"})
option("allow_realloc", {description = "allow initial malloc size to grow to max line length (when using the heap)", default = false, type = "boolean"})

Expand All @@ -12,12 +12,12 @@ target("inih")
add_files("ini.c")
add_headerfiles("(ini.h)")

if has_config("with_ini_parser") then
if has_config("ini_parser") then
add_files("cpp/INIReader.cpp")
add_headerfiles("(cpp/INIReader.h)")
end

if has_config("use_heap") then
if has_config("heap") then
add_defines("INI_USE_STACK=0")
end

Expand Down
8 changes: 4 additions & 4 deletions packages/i/inih/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ package("inih")

add_deps("meson", "ninja")

add_configs("with_ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"})
add_configs("use_heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"})
add_configs("ini_parser", {description = "compile and (if selected) install INIReader", default = true, type = "boolean"})
add_configs("heap", {description = "allocate memory on the heap using malloc instead using a fixed-sized line buffer on the stack", default = false, type = "boolean"})
add_configs("max_line_length", {description = "maximum line length in bytes", default = "200", type = "string"})
add_configs("allow_realloc", {description = "allow initial malloc size to grow to max line length (when using the heap)", default = false, type = "boolean"})

on_install(function (package)
os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua")
local configs = {}
configs.with_ini_parser = package:config("with_ini_parser")
configs.use_heap = package:config("use_heap")
configs.ini_parser = package:config("ini_parser")
configs.heap = package:config("heap")
configs.max_line_length = package:config("max_line_length")
configs.allow_realloc = package:config("allow_realloc")
import("package.tools.xmake").install(package, configs)
Expand Down

0 comments on commit f502680

Please sign in to comment.