actboy168 / luamake

MIT License
171 stars 36 forks source link

add macos arch variable support #37

Closed RequiemSouls closed 9 months ago

RequiemSouls commented 9 months ago

lm.arch currently has a value only in the Window. Now, expose the arch variable from Bee on the macOS.

actboy168 commented 9 months ago

lm.arch means the arch of the compilation target. When it is nil, the default value of the compiler is used, usually the arch of the host os. msvc has no default value, so you must specify one, but this is not required on macos or linux.

require "bee.platform".Arch means luamake's own arch, which is not the same thing as the arch of the host os.

RequiemSouls commented 9 months ago

Thanks for you replay.

Understood, I should be to specify arch within the projects that use luamake. The original reason for this PR was to provide support for macOS x86 in the Ant. So, I should use require("bee.platform").Arch to obtain the arch of the current compile environment for making decisions in the Ant, right?

RequiemSouls commented 9 months ago

https://github.com/RequiemSouls/ant/commit/104cdeb33b6ade302afac48ef36a7be96cb2e2e1

like this

actboy168 commented 9 months ago

You can write in the script.

lm.arch = "arm64"
if lm.arch == "x86_64" then
  --do something
end

Then specify arch in the command.

luamake -arch x86_64