Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform auto-detection #847

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Add platform auto-detection #847

merged 2 commits into from
Apr 28, 2024

Conversation

Sainan
Copy link
Member

@Sainan Sainan commented Apr 25, 2024

No description provided.

@Sainan Sainan linked an issue Apr 25, 2024 that may be closed by this pull request
@alerque
Copy link

alerque commented Apr 25, 2024

Better make sure you're not loosing the ability to cross-compile while doing this. That's the usual pitfall of trying to do platform detection at compile time.

@Sainan
Copy link
Member Author

Sainan commented Apr 25, 2024

Fair point, although I think it's not a huge concern, e.g. if you're on a Linux machine, you're not gonna be targeting Windows — I'm not sure that would even be possible.

And otherwise I do think the compiler should be setting the correct macros, e.g. if you're on a X86 machine targeting ARM64, MSVC would stop defining _M_IX86 and start defining _M_ARM64.

@alerque
Copy link

alerque commented Apr 25, 2024

Is is possible with Lua, that's why I thought to mention it. I build Lua interpreter binaries and various apps with Lua interpreters bundled into them targeting Windows from Linux all the time (see e.g. the luacheck.exe assets on LuaCheck project releases, those are all built on Linux).

@Sainan
Copy link
Member Author

Sainan commented Apr 25, 2024

That's interesting. Do you think these changes would break your cross-compiling workflow?

@well-in-that-case well-in-that-case merged commit 895e4dd into main Apr 28, 2024
8 checks passed
@well-in-that-case well-in-that-case deleted the smart-platform branch April 28, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get rid of LUA_USE_{POSIX,_LINUX} macros
3 participants