premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.13k stars 611 forks source link

Issue trying to fix x86 Linux build #2185

Open redorav opened 4 months ago

redorav commented 4 months ago

I'm trying to fix the x86 Linux build as was reported here, as well as some other small issues I have. I found the bit of code that does the remapping, it's a function archFromConfig that looks like this:

function vstudio.archFromConfig(cfg, win32)
    local isnative = project.isnative(cfg.project)

    local arch = architecture(cfg.system, cfg.architecture)

    if not arch then
        arch = iif(isnative, "x86", "Any CPU")
    end

    if win32 and isnative and arch == "x86" then
        arch = "Win32"
    end

    return arch
end

It looked like it should be pretty easy to change, but it turns out it's more complicated for some reason. I tried doing

if win32 and isnative and arch == "x86" and cfg.system ==p.WINDOWS then

and also tried

if win32 and isnative and arch == "x86" and cfg.system ~=p.LINUX then

but neither of those work, they break the windows platform that appears as x86 instead of the current Win32

I notice that this function function vstudio.archFromConfig(cfg, win32) gets called with win32 set to true in many places, and I'm not sure what it means or why the system doesn't match what I'm trying to do. Any advice on how to move forward?