diff options
| author | Saikari <[email protected]> | 2026-01-29 08:04:49 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-29 08:04:49 +0300 |
| commit | 165aac84db81a518498b59d350054cd1736d56ae (patch) | |
| tree | f938b3649fffd3a88b2d3e5e2385864f6fa69203 | |
| parent | 8b51f4e9b8670a346cf0cc985de989768ec3ea0d (diff) | |
refactor: simplify architecture checks in init function
| -rw-r--r-- | xmake/modules/core/tools/nim.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/nim.lua b/xmake/modules/core/tools/nim.lua index a425b9b37..1fd3cab44 100644 --- a/xmake/modules/core/tools/nim.lua +++ b/xmake/modules/core/tools/nim.lua @@ -38,16 +38,16 @@ function init(self) -- init arch flags local arch = self:arch() if arch then - if arch == "x86" or arch == "i386" then + if self:is_arch("x86", "i386") then self:add("ncflags", "--cpu:i386", "--define:bit32") if self:is_plat("linux", "macosx", "bsd", "mingw") then self:add("ncflags", "--passC:\"-m32\"", "--passL:\"-m32\"") end - elseif arch == "x86_64" then + elseif self:is_arch("x64", "x86_64") then self:add("ncflags", "--cpu:amd64", "--define:bit64") - elseif arch == "arm64" then + elseif self:is_arch("arm64.*") then self:add("ncflags", "--cpu:arm64", "--define:bit64") - elseif arch:startswith("arm") then + elseif self:is_arch("arm.*") then self:add("ncflags", "--cpu:arm", "--define:bit32") end end |
