diff options
| author | carols <[email protected]> | 2020-04-07 06:27:55 +0800 |
|---|---|---|
| committer | carols <[email protected]> | 2020-04-07 06:49:24 +0800 |
| commit | be8a297e88822f95cebcbcf8c6d15fc844050507 (patch) | |
| tree | 57509724f5f837ce20cd650dd1e9bb810022689d | |
| parent | f4ecb2c0dfb21b0566e15efdae5b4f4069a274c9 (diff) | |
simplify code
| -rw-r--r-- | xmake/rules/qt/load.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua index 06a33fede..295512d87 100644 --- a/xmake/rules/qt/load.lua +++ b/xmake/rules/qt/load.lua @@ -167,8 +167,8 @@ function main(target, opt) -- translate qt frameworks if framework:startswith("Qt") then -- add private includedirs - if (framework:lower():endswith("private")) then - local private_dir = framework:sub(1, -string.len("private") - 1); + if framework:lower():endswith("private") then + local private_dir = framework:sub(1, -#("private") - 1); if is_plat("macosx") then local frameworkdir = path.join(qt.sdkdir, "lib", framework .. ".framework") if os.isdir(frameworkdir) then @@ -206,11 +206,9 @@ function main(target, opt) -- remove private frameworks local local_frameworks = {} - local index = 1 for _, framework in ipairs(target:get("frameworks")) do if not framework:lower():endswith("private") then - local_frameworks[index] = framework - index = index + 1 + table.insert(local_frameworks, framework) end end |
